The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →
Top 23 Go Code-Generator Projects
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
xo
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, and Microsoft SQL Server (by xo)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
hof
Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.
-
copygen
Go generator to copy values from type to type and fields from struct to struct (copier without reflection). Generate any code based on types.
-
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
"Is there a way to get sqlc to use pointers for nullable columns instead of the sql.Null types?"
A huge time-saver for me when generating table-driven test boilerplate in Go has been using gotests[0] to generate the template.
If you use VSCode with the Go extension it's already available there as a command "Go: Generate Unit Tests for Function/Package".
[0] https://github.com/cweill/gotests
Project mention: Open-sourcing SQX, a way to build flexible database models in Go | news.ycombinator.com | 2023-09-02i like xo's approach https://github.com/xo/xo but it is as is. I would love if something similar comes along that is used by db practititoners that is actively used and supported.
We have a repo/library called fasten-sources which is made up of mostly generated code (using dave/jennifer)
Project mention: Open-sourcing SQX, a way to build flexible database models in Go | news.ycombinator.com | 2023-09-02We are really happy using jet. It lets you write type safe SQL and can read the results into structs- including joins into slice fields.
https://github.com/go-jet/jet
Project mention: I write HTTP services in Go after 13 years (Mat Ryer, 2024) | news.ycombinator.com | 2024-02-09https://github.com/ogen-go/ogen
Write openapi definition, it'll do routing, definition of structs, validation of JSON schemas, etc.
All I need to do is implement the service.
Validating an integer range for a querystring parameter is just too boring. And too easy to mistype when writing it manually.
Anyways, so far only been playing, so haven't found the bad parts yet.
Project mention: Ask HN: Are SQL developers generally familiar with JSON, VSCode and Docker? | news.ycombinator.com | 2024-03-14Many business analysts use SQL, have for a long time. They are probably not your target audience. With the problem being JAVA specific, you'd likely want to start there
This sounds similar to the goals of my hof tool (https://github.com/hofstadter-io/hof), lift type definitions out of code so they can be defined in one place, then generate the code for all the places. Is that sounding like what you are after?
Project mention: middlewarer - Generate a middleware framework for any Go interface | /r/golang | 2023-06-30To solve this, I created middlewarer. It's a Go generator that generates a middleware framework for any Go interface.With middlewarer, I was able to define logging and prometheus middleware generically for all the relevant structs.I made sure that users must not define middleware for every single interface method, which makes the resulting code a lot slimmer and easier to read.
Go Code-Generator related posts
- Ask HN: Are SQL developers generally familiar with JSON, VSCode and Docker?
- Ask HN: What's the most compelling AI prompt result you've seen?
- How do you provide documentation for your REST APIs?
- How we built a codegen solution for SDKs to create humanlike code
- What is the benefit of creating a server struct?
- Show HN: YAML to Django Using ChatGPT
- A little bit faster way to deep copy in golang
-
A note from our sponsor - WorkOS
workos.com | 27 Apr 2024
Index
What are some of the best open-source Code-Generator projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | sqlc | 10,950 |
2 | GoSwagger | 9,271 |
3 | gotests | 4,849 |
4 | xo | 3,563 |
5 | jennifer | 3,177 |
6 | jet | 2,025 |
7 | ogen | 1,072 |
8 | hof | 475 |
9 | copygen | 331 |
10 | xgen | 291 |
11 | kyaml2go | 286 |
12 | openapi-cli-generator | 168 |
13 | toolkit | 158 |
14 | deep-copy | 148 |
15 | openapi-generator-go | 94 |
16 | easygen | 62 |
17 | convergen | 27 |
18 | hofmod-cli | 25 |
19 | mjson2go | 22 |
20 | newc | 19 |
21 | gogenswagger | 5 |
22 | middlewarer | 3 |
23 | goat | 0 |
Sponsored