SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 Go Code-Generator Projects
-
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
-
-
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server (by xo)
XO doesn’t have them built-in, but it uses easily customizable templates.
I added support for a bunch of postgres fancy stuff in a previous app, it wasn’t too difficult
https://github.com/xo/xo
-
-
It gets mentioned a lot in the context of database/sql and sqlc alternatives, but Jet has been a great alternative so far, most notably because of its non-issue with dynamic queries support.
https://github.com/go-jet/jet/
-
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/
-
InfluxDB
InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
-
hof
Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.
Project mention: How to include Git version information in a Golang binary | news.ycombinator.com | 2025-01-19 -
copygen
Copygen generates code based on Go types. Generate type-based code to copy values from type to type and fields from struct to struct by default (copier without reflection).
-
-
-
Project mention: Show HN: Rill – Composable concurrency toolkit for Go | news.ycombinator.com | 2024-11-25
Sourcegraph Conc is broadly similar in providing pool helpers, but doesn't provide the same fine grained batching options: https://github.com/sourcegraph/conc
Uber CFF does code generation, and has more of a focus on readability and complex dependency chains: https://github.com/uber-go/cff
-
-
-
-
openapi-generator-go
An opinionated OpenAPI v3 code generator for Go. Use this to generate API models and router scaffolding.
-
-
-
-
-
-
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Go Code-Generator discussion
Go Code-Generator related posts
-
How to include Git version information in a Golang binary
-
Libero – A Programmer's Tool and Code Generator [Legacy]
-
Hof v0.6.9 – more CUE powered tools and extensions
-
Show HN: Use Go's HTML/template to write React-like code
-
Show HN: Syntax highliting tool for code snippets in HTML
-
Using Cuelang With Go for extracting structured data from LLMs
-
Looking for help with transpiling TypeScript to Golang and Python using LLMs
-
A note from our sponsor - SaaSHub
www.saashub.com | 23 Apr 2025
Index
What are some of the best open-source Code-Generator projects in Go? This list will help you:
# | Project | Stars |
---|---|---|
1 | sqlc | 14,792 |
2 | GoSwagger | 9,724 |
3 | gotests | 5,014 |
4 | xo | 3,806 |
5 | jennifer | 3,472 |
6 | jet | 3,087 |
7 | ogen | 1,672 |
8 | hof | 543 |
9 | copygen | 381 |
10 | xgen | 359 |
11 | kyaml2go | 284 |
12 | cff | 205 |
13 | openapi-cli-generator | 190 |
14 | toolkit | 159 |
15 | deep-copy | 155 |
16 | openapi-generator-go | 109 |
17 | easygen | 64 |
18 | convergen | 45 |
19 | newc | 33 |
20 | hofmod-cli | 26 |
21 | mjson2go | 24 |
22 | sqlc-gen-fsharp | 18 |
23 | gogenswagger | 5 |