Go Codegen

Open-source Go projects categorized as Codegen

Top 22 Go Codegen Projects

  1. wire

    Compile-time Dependency Injection for Go

    Project mention: Dependency Injection in Go: Comparing Wire, Dig, Fx & More | dev.to | 2025-02-05

    Wire is a compile-time dependency injection tool developed by Google. It generates Go code that manually wires dependencies before compilation, ensuring that there is no runtime overhead.

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. gqlgen

    go generate based graphql server library

    Project mention: Navigating System Communication: A Comprehensive Overview | dev.to | 2024-08-01

    To take a more in-depth look at how GraphQL works, check out this project built using Go and gqlgen.

  4. moq

    Interface mocking tool for go generate (by matryer)

  5. ogen

    OpenAPI v3 code generator for go

    Project mention: Rails for Everything | news.ycombinator.com | 2025-01-01

    With tools like ogen[1], one can take a single Swagger or OpenAPI doc and generate server code with request/response validation, Prometheus metrics, OpenTelemetry, and more.

    It can also generate clients and webhooks. Authentication is just declaring a SecurityScheme in the OpenAPI documentation then implementing a single function. The rest of the backend is just implementing a single interface. Unlike oapi-codegen, there is no need to tinker with middleware for authentication or logging.

    Pair this with a tool like sqlc[2] and SQLite's `pragma user_version`, and you get type-safe database code and database migrations for free. I will concede that adding SQLite is a manual process, but its just two imports added to main.go.

    Frontend is entirely your choice. Go's standard library provides good enough text templating that I don't miss ERB or Django-style templates. Using embed/fs, one can easily embed a bunch of assets into a single static binary, so deployment can be as simple as `go build` and moving a single binary.

    I actually have a hard time using languages besides Go for developing backends, because the code generation tools eliminate the boilerplate I frequently face in other languages while also avoiding the hundreds of dependencies that Spring Boot or Quarkus need.

    [1] https://ogen.dev/

  6. genqlient

    a truly type-safe Go GraphQL client

  7. vtprotobuf

    A Protocol Buffers compiler that generates optimized marshaling & unmarshaling Go code for ProtoBuf APIv2

    Project mention: Go Protobuf: The New Opaque API | news.ycombinator.com | 2024-12-16
  8. oto

    Go driven rpc code generation tool for right now. (by pacedotdev)

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. tygo

    Generate Typescript types from Golang source code

  11. interfaces

    Code generation tools for Go. (by rjeczalik)

  12. kyaml2go

    K8s Go client code generator from Kubernetes resource yamls

  13. options-gen

    Codegen for functional options in go projects

  14. sqlgen

    A tool to generate bun, gorm, sql, sqlx and xorm sql code. (by kesonan)

  15. githubevents

    GitHub webhook events toolset for Go :rocket:

  16. gut

    Convert Golang structs to Typescript interfaces (by tompston)

  17. gomarvin

    Generate Go REST servers & http clients

  18. revgen

    Speed up go:generate by auto detecting code changes

  19. structuresmith

    Validate, Diff, Render - A powerful tool designed to automate the generation of project files using customizable templates.

  20. projectforge

    Project Forge helps you build applications with Go

    Project mention: Ask HN: Is there any software you only made for your own use but nobody else? | news.ycombinator.com | 2024-07-04

    I’ve spent five years and 100KLoC building https://github.com/kyleu/projectforge which helps generate and update other Golang projects I maintain. I use it daily.

  21. sqlc-gen-fsharp

    Sqlc plugin to generate F# code from SQL

  22. cddlc

    WIP: Parser and Code Generator for the Concise Data Definition Language (CDDL)

    Project mention: A compiler/code generator for the Concise Data Definition Language(RFC 8610) | news.ycombinator.com | 2024-10-24
  23. terraform-provider-hashicups

    (Template, Clone this to get started) Terraform provider for Hashicups. (by speakeasy-sdks)

  24. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Go Codegen discussion

Log in or Post with

Go Codegen related posts

  • Show HN: Protobuf-go-lite: reflection-free protobuf for Go with JSON support

    3 projects | news.ycombinator.com | 8 Nov 2024
  • Navigating System Communication: A Comprehensive Overview

    4 projects | dev.to | 1 Aug 2024
  • GraphQL Types

    1 project | dev.to | 3 Jul 2024
  • @Autowired magic in SpringBoot

    1 project | dev.to | 16 Jun 2024
  • Show HN: Structuresmith – Generate Project Files and Templates for Consistency

    1 project | news.ycombinator.com | 10 Dec 2023
  • vektra/mockery has fully released the "packages" feature! This blog explains what it is and how it works.

    1 project | /r/golang | 11 Jul 2023
  • GitHub - Warashi/compgen: Compgen is a gqlgen plugin designed to simplify the generation of ComplexityRoot for gqlgen.

    2 projects | /r/golang | 1 Jun 2023
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 21 May 2025
    InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now. Learn more →

Index

What are some of the best open-source Codegen projects in Go? This list will help you:

# Project Stars
1 wire 13,746
2 gqlgen 10,334
3 moq 2,077
4 ogen 1,706
5 genqlient 1,206
6 vtprotobuf 976
7 oto 838
8 shortlink 764
9 tygo 722
10 interfaces 430
11 kyaml2go 284
12 options-gen 90
13 sqlgen 84
14 githubevents 80
15 gut 72
16 gomarvin 57
17 revgen 43
18 structuresmith 33
19 projectforge 18
20 sqlc-gen-fsharp 18
21 cddlc 8
22 terraform-provider-hashicups 3

Sponsored
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com