Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. go-dry

go-dry

MITGo

A comprehensive utility package for Go that eliminates common boilerplate code with helpers for strings, files, HTTP, errors, and concurrency.

GitHubGitHub
488 stars37 forks0 contributors

What is go-dry?

go-dry is a Go utility library that provides a comprehensive collection of helper functions and types to eliminate repetitive boilerplate code in Go applications. It offers utilities for common tasks like string manipulation, file I/O, HTTP handling, error management, concurrency, and encryption, enabling developers to write more concise and consistent code. The library adheres to the DRY (Don't Repeat Yourself) principle, aiming to reduce redundancy and accelerate development.

Target Audience

Go developers working on applications that involve frequent string processing, file operations, web server development, or concurrent data handling, and who seek to minimize boilerplate code. It is particularly useful for backend developers building web services, CLI tools, or systems requiring utilities for JSON/XML marshaling, encryption, and thread-safe operations.

Value Proposition

Developers choose go-dry for its extensive, all-in-one set of utilities that cover a wide range of common Go programming patterns, reducing the need to write or import multiple specialized packages. Its unique selling point is the integration of thread-safe types, error collection with ErrorList, and performance optimizations like compression pools, which streamline development while maintaining consistency across projects.

Overview

DRY (don't repeat yourself) package for Go

Use Cases

Best For

  • Building web servers in Go that require HTTP utilities for JSON/XML marshaling, compression, and request handling.
  • Developing CLI tools or scripts that need robust file I/O operations for reading/writing JSON, XML, CSV, or config files.
  • Implementing concurrent applications where thread-safe wrappers for primitives (e.g., SyncInt, SyncMap) are necessary to manage shared state.
  • Reducing boilerplate code in Go projects by using utilities for string parsing, conversion, and transformation (e.g., StringToInt, StringFindBetween).
  • Handling error collection and debugging with features like ErrorList for multiple errors and panic helpers with stack traces.
  • Performing encryption and byte operations, such as AES encryption/decryption with pooling or compression for byte slices.

Not Ideal For

  • Projects that prioritize minimal dependencies and stick strictly to the Go standard library to avoid third-party packages.
  • Security-critical applications requiring audited cryptographic implementations, given go-dry's warnings against using its hash functions for security purposes.
  • Teams that prefer specialized, single-purpose libraries for better maintenance and updates, as go-dry's broad scope can introduce unnecessary complexity.
  • Situations where explicit error handling is essential, since functions like StringToInt return zero values on errors instead of propagating errors.

Pros & Cons

Pros

Comprehensive Utility Coverage

Offers a wide range of helpers for strings, files, HTTP, errors, and more, such as StringFindBetween for text extraction and FileUnmarshallJSON for easy file parsing, reducing repetitive code.

Thread-Safe Concurrency Types

Includes SyncInt, SyncMap, and other wrappers that simplify shared state management in concurrent applications without manual mutex handling, as shown in the thread-safe examples.

Efficient Error Collection

Features ErrorList for accumulating multiple errors and PanicIfErr with stack traces, making debugging easier and error handling more organized in complex operations.

Performance Optimizations

Implements compression pools like Gzip.GetWriter for resource reuse, optimizing throughput in data-intensive scenarios like HTTP response handling.

Cons

Security Caveats

The README explicitly warns that MD5 and SHA1 functions are for non-cryptographic use only, and input validation in utilities like StringToInt may silently fail by returning zero values, hiding errors in production code.

Dependency Overhead

As a monolithic utility package, it can introduce bloat and potential conflicts with other libraries, especially if only a subset of features is needed, increasing project complexity.

Error Handling Abstraction

Functions that abstract error checking, such as returning zero values on parse errors, might encourage poor practices if developers overlook the warnings, leading to less robust applications.

Frequently Asked Questions

Quick Stats

Stars488
Forks37
Contributors0
Open Issues0
Last commit9 months ago
CreatedSince 2014

Tags

#boilerplate-reduction#encryption#file-io#utility-library#error-handling#concurrency#reflection#go#string-manipulation

Built With

G
Go

Included in

Go169.1k
Auto-fetched 18 hours ago

Related Projects

fzffzf

:cherry_blossom: A command-line fuzzy finder

Stars81,940
Forks2,820
Last commit1 day ago
divedive

A tool for exploring each layer in a docker image

Stars54,353
Forks1,991
Last commit7 months ago
HubHub

A command-line tool that makes git easier to use with GitHub.

Stars22,957
Forks2,222
Last commit2 years ago
lolo

💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)

Stars21,394
Forks946
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub