Go Code-Generator

Open-source Go projects categorized as Code-Generator

Top 23 Go Code-Generator Projects

Code-Generator
  1. sqlc

    Generate type-safe code from SQL

    Project mention: Sqlc: Generate type-safe code from SQL | news.ycombinator.com | 2025-04-16
  2. 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.

    CodeRabbit logo
  3. GoSwagger

    Swagger 2.0 implementation for go

  4. gotests

    Automatically generate Go test boilerplate from your source code.

  5. xo

    Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server (by xo)

    Project mention: Sqlc: Compile SQL to type-safe code | news.ycombinator.com | 2024-09-08

    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

  6. jennifer

    Jennifer is a code generator for Go

  7. jet

    Type safe SQL builder with code generation and automatic query result data mapping

    Project mention: Some Go web dev notes | news.ycombinator.com | 2024-09-29

    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/

  8. 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/

  9. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  10. 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
  11. 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).

  12. xgen

    XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator (by xuri)

  13. kyaml2go

    K8s Go client code generator from Kubernetes resource yamls

  14. cff

    Concurrency toolkit for Go

    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

  15. openapi-cli-generator

    Generate a CLI from an OpenAPI 3 specification

  16. toolkit

    Collection of useful patterns (by donutloop)

  17. deep-copy

    Deep copy generator

  18. openapi-generator-go

    An opinionated OpenAPI v3 code generator for Go. Use this to generate API models and router scaffolding.

  19. easygen

    Easy to use universal code/text generator

  20. convergen

    A type-to-type copy function code generator.

  21. newc

    A code generator that generates constructor code for Golang structures.

  22. hofmod-cli

    Hofstadter generator for Golang CLIs

  23. mjson2go

    A tool to convert a MongoDB pipeline into parameterized Go code.

  24. sqlc-gen-fsharp

    Sqlc plugin to generate F# code from SQL

  25. gogenswagger

    gogenswagger will generate signatures for the test case using swagger json file

  26. 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 Code-Generator discussion

Log in or Post with

Go Code-Generator related posts

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

Sponsored
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.
coderabbit.ai

Did you know that Go is
the 4th most popular programming language
based on number of references?