Go Code Generation

Open-source Go projects categorized as Code Generation

Top 23 Go Code Generation Projects

  • go-zero

    A cloud-native Go microservices framework with cli tool for productivity.

    Project mention: A simple way to use sync.WaitGroup. | /r/golang | 2023-02-14
  • goa

    Design-based APIs and microservices in Go

    Project mention: Which is the best framework to create web apps with go? | /r/golang | 2023-06-29

    If you really need a framework, you can take a look at Echo or, for a contract-first approach, https://goa.design/

  • Mergify

    Updating dependencies is time-consuming.. Solutions like Dependabot or Renovate update but don't merge dependencies. You need to do it manually while it could be fully automated! Add a Merge Queue to your workflow and stop caring about PR management & merging. Try Mergify for free.

  • easyjson

    Fast JSON serializer for golang.

    Project mention: Google's Go may add telemetry reporting that's on by default | /r/golang | 2023-02-10

    Compile time means you catch issues at... well compile time. It also means that the code is optimized. You can look at the performance different between encoding/json and easyjson for why you may desire that.

  • jennifer

    Jennifer is a code generator for Go

    Project mention: How to minimize RAM usage during Go binary compilation | /r/golang | 2023-07-11

    We have a repo/library called fasten-sources which is made up of mostly generated code (using dave/jennifer)

  • go-recipes

    🦩 Tools for Go projects

    Project mention: 2023 update to go-recipes collection | /r/golang | 2023-06-06
  • avo

    Generate x86 Assembly with Go

    Project mention: How to Use AVX512 in Golang | news.ycombinator.com | 2023-01-22

    I thought the /r/golang comments on this post were pretty useful[1]. They also introduced me to avo[2], a tool for generating x86 assembly from go that I hadn't seen before. There are some examples listed on the avo github page for generating AVX512 instructions with avo.

    1 = https://www.reddit.com/r/golang/comments/10hmh07/how_to_use_...

    2 = https://github.com/mmcloughlin/avo

  • gnostic

    A compiler for APIs described by the OpenAPI Specification with plugins for code generation and other API support tasks.

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • GoWrap

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

    Project mention: Does anyone know a pattern/library for creating editable generated files? | /r/golang | 2023-01-15
  • truss

    Truss helps you build go-kit microservices without having to worry about writing or maintaining boilerplate code.

  • zek

    Generate a Go struct from XML.

    Project mention: Newbie: I have a big xml file, the content is much nested tags and what I need to do is adding a field in a very nested tag in this file. One “not elegant” way is to make thousands of structs to parse the file. Do you guys have a simple solution for a task like that. | /r/golang | 2023-01-30

    I use zek for big XML operations. You give it an XML file and it outputs a struct — https://github.com/miku/zek

  • webrpc

    webrpc is a schema-driven approach to writing backend services for modern Web apps and networks

    Project mention: Go server + TypeScript client with end-to-end type safety? | /r/golang | 2023-04-12

    Webrpc is what you're looking for: https://github.com/webrpc/webrpc

  • go-jsonschema

    A tool to generate Go data types from JSON Schema definitions.

    Project mention: JSON Schema generator | /r/golang | 2023-02-07

    What I have tried: https://github.com/atombender/go-jsonschema gave that a spin and wasn't able to generate any successful types from the few items under objects I tried.

  • goverter

    Generate type-safe Go converters by simply defining an interface

  • enumer

    A Go tool to auto generate methods for your enums (by dmarkham)

    Project mention: Go isn't the right tool for ANY job | /r/golang | 2022-12-02

    Just use const blocks, iota and enumer and be happy.

  • 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.

    Project mention: The Icculus Microgrant is giving out 250 dollar grants to open source projects, please brag about your project(s) in this thread so I can see them! | /r/programming | 2023-03-03

    Copygen is a type-based code generator for the Go programming language. Copygen allows developers to generate type-to-type copy functions out-of-the-box without reflection (why?), but it can also be used to generate code. As an example, disgo is a performant, secure, and thread-safe Go Discord API Wrapper that uses Copygen with dasgo to achieve feature completion.

  • charlatan

    Go Interface Mocking Tool

  • toolkit

    Collection of useful patterns (by donutloop)

  • openapi-go

    OpenAPI structures for Go

    Project mention: [Request] Library Recommendation for Auto Swagger/OpenAPIv3 Documentation | /r/golang | 2023-05-27

    Also check out https://github.com/swaggest/openapi-go if you want more low level control of mapping structs to OpenAPI representation.

  • gofire

    Gofire 🔥 Command Line Interface Generator tool for Go (by 1pkg)

  • dingo

    Generated dependency injection containers in go (golang) (by sarulabs)

    Project mention: What's the best dependency injection framework / methodology for Golang for the enterprise? | /r/golang | 2022-12-21
  • templify

    A tool to be used with 'go generate' to embed external template files into Go code.

  • apibrew

    APIBrew is Low code software to automate building CRUDs from yaml files (by apibrew)

    Project mention: Low code software to automate building CRUDs from YAML files | news.ycombinator.com | 2023-05-04
  • newc

    A code generator that generates constructor code for Golang structures.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

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). The latest post mention was on 2023-07-11.

Go Code Generation related posts

Index

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

Project Stars
1 go-zero 25,552
2 goa 5,295
3 easyjson 4,223
4 jennifer 3,019
5 go-recipes 2,774
6 avo 2,424
7 gnostic 1,841
8 GoWrap 802
9 truss 723
10 zek 687
11 webrpc 605
12 go-jsonschema 372
13 goverter 313
14 enumer 302
15 copygen 286
16 charlatan 199
17 toolkit 157
18 openapi-go 142
19 gofire 108
20 dingo 95
21 templify 30
22 apibrew 29
23 newc 15
Clean code begins in your IDE with SonarLint
Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.
www.sonarlint.org