Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. goderive

goderive

Apache-2.0Gov0.6.0

A Go code generator that automatically derives and maintains mundane functions like equality checks, deep copies, and functional operations from your types.

GitHubGitHub
1.3k stars45 forks0 contributors

Overview

Derives and generates mundane golang functions that you do not want to maintain yourself

Use Cases

Not Ideal For

  • Projects heavily utilizing Go 1.18+ generics for collection operations
  • Teams preferring minimal build tooling and zero code generation steps
  • Codebases requiring highly optimized, hand-written functions for performance-critical sections

Pros & Cons

Pros

Automatic Boilerplate Elimination

Parses Go code to detect unimplemented functions with 'derive' prefixes and generates accurate implementations, as shown for struct equality with pointers and nested conditionals.

Recursive Type Handling

Generates functions like deriveEqual and deriveDeepCopy that work recursively on complex types, including pointers and nested structs, ensuring thorough coverage without manual updates.

Functional Programming Support

Provides derived functions for fmap, compose, and traverse, enabling functional patterns in Go, as detailed in the functional examples section of the README.

Self-Updating Code Synchronization

Regenerates functions when underlying types change, keeping derived implementations in sync with data structures and reducing maintenance errors from manual updates.

Cons

Deprecated Features

Many collection operations like deriveSort and deriveKeys are deprecated in favor of Go's generics, reducing the tool's relevance for new code and signaling obsolescence in parts of its feature set.

Build Process Overhead

Requires running goderive as a separate step (e.g., 'goderive ./...') or via go generate, adding complexity to development workflows and CI/CD pipelines compared to pure Go code.

Generated Code Verbosity

Can produce verbose and potentially inefficient code, such as the nested conditionals in the deriveEqual example, which might not match the performance or readability of hand-optimized implementations.

Frequently Asked Questions

Quick Stats

Stars1,261
Forks45
Contributors0
Open Issues18
Last commit17 days ago
CreatedSince 2017

Tags

#generator#functional-programming#developer-tools#boilerplate-reduction#productivity#deriving#golang#generics#go#code-generation#automation#type-driven

Built With

G
Go

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

oapi-codegenoapi-codegen

Generate Go client and server boilerplate from OpenAPI 3 specifications

Stars8,529
Forks1,055
Last commit1 day ago
go-linqgo-linq

.NET LINQ capabilities in Go

Stars3,662
Forks226
Last commit2 days ago
jenniferjennifer

Jennifer is a code generator for Go

Stars3,628
Forks162
Last commit1 year ago
GoWrapGoWrap

GoWrap is a command line tool for generating decorators for Go interfaces

Stars1,335
Forks94
Last commit28 days 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