Go Code-Generator

Open-source Go projects categorized as Code-Generator

Top 23 Go Code-Generator Projects

  • sqlc

    Generate type-safe code from SQL

  • Project mention: Show HN: Riza – Safely run untrusted code from your app | news.ycombinator.com | 2024-04-30

    Hi HN, I’m Kyle and together with Andrew (https://news.ycombinator.com/user?id=stanleydrew) we’ve been working on Riza (https://riza.io), a project to make WASM sandboxing more approachable. We’re excited to share a developer preview of our code interpreter API with HN.

    There’s a bit of a backstory here. A few months ago, an old coworker reached out asking how to execute untrusted code generated by an LLM. Based on our experience building a plugin system for sqlc (https://sqlc.dev), we thought a sandboxed WASM runtime would be a good fit. A bit of hacking later, we got everything wired up to solve his issue. Now the API is ready for other developers to try out.

    The Riza Code Interpreter API is an HTTP interface to various dynamic language interpreters, each running inside a WASM sandbox without access to the outside world (for now). We modeled the API to align with a POSIX shell-style interface.

    We made a playground so you can try it out without signing up: https://riza.io

    The API documentation lives here: https://docs.riza.io

    There are many limitations at the moment, but we expect to rapidly expand capabilities so that programs can e.g. access the network and filesystem. Our roadmap has more details: https://docs.riza.io/reference/roadmap

    If you need to execute LLM-generated code we’d love to have you try the API and let us know if you run into any issues. You can email us directly at [email protected].

  • GoSwagger

    Swagger 2.0 implementation for go

  • Project mention: How do you provide documentation for your REST APIs? | /r/golang | 2023-11-24
  • 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.

    InfluxDB logo
  • gotests

    Automatically generate Go test boilerplate from your source code.

  • Project mention: Russ Cox: Go Testing by Example | news.ycombinator.com | 2023-12-05

    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

  • 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: Open-sourcing SQX, a way to build flexible database models in Go | news.ycombinator.com | 2023-09-02

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

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

  • jet

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

  • Project mention: Eradicating N+1s: The Two-Phase Data Load and Render Pattern in Go | news.ycombinator.com | 2024-05-28

    Jet can automatically load joined objects into embedded Go structs: https://github.com/go-jet/jet/wiki/Query-Result-Mapping-(QRM...

    Depending on what you are doing there might be some duplication that you could remove by creating hash lookups as in this post, but I would reach for Jet first.

    sqlc supports embedding but not embedded slices?

  • ogen

    OpenAPI v3 code generator for go

  • Project mention: I write HTTP services in Go after 13 years (Mat Ryer, 2024) | news.ycombinator.com | 2024-02-09

    https://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.

  • SaaSHub

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

    SaaSHub logo
  • hof

    Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.

  • Project mention: Show HN: Use Go's HTML/template to write React-like code | news.ycombinator.com | 2024-05-27

    Go's text/template (basically the same as html/template, with fewer safe guards) is pretty powerful. You can add custom functions and partial templates too. I use these concepts in https://docs.hofstadter.io to generate any code, not just frontend.

    For frontend, as in your example, this has the older feel for UI, where each navigation requires a round trip to the server and a full-page response to the client. This is part of the reason people have moved to React and full-stack TS. I love Go, but I'm definitely a big fan of writing webapps in Next at this point. React Server Components are a really nice DX.

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

  • xgen

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

  • kyaml2go

    K8s Go client code generator from Kubernetes resource yamls

  • openapi-cli-generator

    Generate a CLI from an OpenAPI 3 specification

  • toolkit

    Collection of useful patterns (by donutloop)

  • deep-copy

    Deep copy generator

  • openapi-generator-go

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

  • easygen

    Easy to use universal code/text generator

  • convergen

    A type-to-type copy function code generator.

  • hofmod-cli

    Hofstadter generator for Golang CLIs

  • newc

    A code generator that generates constructor code for Golang structures.

  • mjson2go

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

  • gogenswagger

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

  • middlewarer

    Generate a middleware framework for any Go interface

  • Project mention: middlewarer - Generate a middleware framework for any Go interface | /r/golang | 2023-06-30

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

  • goat

    Easily generate golang source from templates. (by fluhus)

  • 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 related posts

  • Show HN: Use Go's HTML/template to write React-like code

    7 projects | news.ycombinator.com | 27 May 2024
  • Show HN: Syntax highliting tool for code snippets in HTML

    1 project | news.ycombinator.com | 16 May 2024
  • Using Cuelang With Go for extracting structured data from LLMs

    1 project | news.ycombinator.com | 14 May 2024
  • Looking for help with transpiling TypeScript to Golang and Python using LLMs

    4 projects | news.ycombinator.com | 6 May 2024
  • Ask HN: Are SQL developers generally familiar with JSON, VSCode and Docker?

    1 project | news.ycombinator.com | 14 Mar 2024
  • Ask HN: What's the most compelling AI prompt result you've seen?

    1 project | news.ycombinator.com | 28 Nov 2023
  • How do you provide documentation for your REST APIs?

    1 project | /r/golang | 24 Nov 2023
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 28 May 2024
    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. Learn more →

Index

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

Project Stars
1 sqlc 11,247
2 GoSwagger 9,308
3 gotests 4,869
4 xo 3,579
5 jennifer 3,195
6 jet 2,103
7 ogen 1,113
8 hof 483
9 copygen 332
10 xgen 294
11 kyaml2go 286
12 openapi-cli-generator 174
13 toolkit 158
14 deep-copy 147
15 openapi-generator-go 99
16 easygen 62
17 convergen 30
18 hofmod-cli 25
19 newc 24
20 mjson2go 23
21 gogenswagger 5
22 middlewarer 3
23 goat 0

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com