15 repository-uri
Tools specifically designed to emit idiomatic Go source code from external specifications.
Distinct from Server Boilerplate Generators: The existing candidates focus on general type definitions or server boilerplate; this captures the specific target language generation.
Explore 15 awesome GitHub repositories matching programming languages & runtimes · Go Code Generators. Refine with filters or upvote what's useful.
Wire is a compile-time dependency injection framework for Go that generates code to wire application components together. It analyzes function signatures at compile time to build an explicit initialization graph, removing the need for runtime reflection or manual wiring code. The framework operates as a Go code generator and static analysis tool, transforming annotated source code into generated wire files that compile alongside the original project. It connects dependencies by matching function parameters and return types, producing a directed acyclic graph of component dependencies that is
Produces source code that connects dependencies through explicit function parameters for testable initialization.
Templ is a type-safe HTML templating engine and UI framework for Go. It provides a system for building reusable HTML components that compile into Go code for server-side rendering, ensuring type safety and compile-time validation of data and logic. The project features a dedicated language server that provides autocomplete and syntax validation for template files within supported code editors. It employs compile-time code generation to transform a custom template language into Go source code, enabling the creation of modular HTML fragments and logic blocks. The framework includes automated s
Transforms template files into idiomatic and type-safe Go source code.
oapi-codegen is an OpenAPI specification compiler and code generator for Go. It transforms OpenAPI definitions into type-safe Go client libraries, server boilerplate, and data models to facilitate contract-first API development. The tool distinguishes itself through a flexible customization system that allows users to override generated types and imports via specification extensions. It supports the use of custom text templates to redefine the final source code structure and provides a specification overlay mechanism to modify or remove endpoints without altering the original source file. Th
Creates type definitions and server interfaces in Go to automate API routing and data structures.
This project is a collection of official toolsets and server implementations designed for the parsing, formatting, and semantic analysis of the Go programming language. It includes a language server that provides real-time code intelligence and automated editing capabilities to editors via the Language Server Protocol. The toolset provides a suite of utilities for source code formatting and static analysis. This includes automated standardization of code layout, import organization, and the generation of string representation methods for enumerated types. The project covers broad static anal
Automatically creates string representation methods and declarations for enumerated types in Go source code.
This project is a Go library and runtime for loading and managing eBPF programs and maps. It provides a bytecode loader and kernel interface to inject instructions into kernel hooks for system-level execution and observability across both Linux and Windows operating systems. The library features a relocation engine and tooling to ensure program compatibility across different kernel versions and distributions. It supports portable deployment by embedding compiled objects for multiple CPU architectures into a single binary and provides the ability to load signed system drivers on Windows. The
Automatically creates type-safe wrappers and structures from compiled objects to simplify interaction between user space and the kernel.
Mockery is a code generation tool that produces mock implementations from Go interfaces, designed to simplify unit testing by automating the creation of test doubles. It parses Go source files using abstract syntax tree analysis to extract interface method signatures, then generates complete mock struct types that implement those interfaces with configurable function fields for test injection. The tool distinguishes itself through its configuration and customization capabilities. Rather than embedding directives in source code annotations, Mockery reads generation settings from a YAML configu
Automatically generates mock implementations from Go interfaces for use in unit testing and dependency injection.
go-tools is a collection of utilities for Go static analysis and memory layout optimization. It provides a toolset designed to analyze source code to detect bugs and dead code, alongside specialized tools for optimizing how structs are arranged in memory. The project includes a memory alignment visualizer to display physical memory layouts and padding, as well as a struct layout optimizer that reorders fields to minimize memory padding. Additionally, it provides a boilerplate generator to automate the creation of registration and test files required for developing custom Go analyzers. The to
Creates the repetitive registration and test source code required for developing Go analyzers.
Simplebank is a financial services backend application built with Go that manages bank accounts and transfers. It utilizes a dual-protocol interface, providing both gRPC and REST APIs via Protocol Buffers to support different client communication requirements. The system implements a PostgreSQL data layer with versioned schema migrations and type-safe query generation. It handles financial operations through atomic fund transfers and balance change tracking to maintain consistent audit trails. The architecture includes an asynchronous task worker system using a message queue to offload long-
Translates database schemas and raw queries into type-safe Go code to eliminate manual boilerplate.
CUE is a constraint-based configuration language designed for data validation, schema definition, and code generation. At its core, it unifies types and values into a single concept, enabling compile-time validation that catches structural and value errors before runtime. The language treats data and constraints as the same thing, allowing a single definition to serve as both a schema and concrete configuration data. CUE distinguishes itself through its constraint-based unification engine, which combines multiple configuration sources into a single coherent result by merging their constraints
Produces Go types and code that mirror CUE definitions for type-safe data handling.
This project is a Protocol Buffers Go compiler and code generation framework that translates schema definitions into optimized Go structures and reflection-free serialization methods. It includes a gRPC service generator for producing client and server communication code and a serialization performance toolkit for generating automated benchmarks and test suites. The framework features a plugin-based system for transforming data definitions into source code with custom field mapping and struct tag injection. It allows for custom type mapping and struct type overriding to link data fields to sp
Provides a framework to emit idiomatic Go source code from external schema specifications.
Bud este un framework web full-stack pentru Go care funcționează ca un motor de scaffolding și instrument de generare de cod. Automatizează crearea structurilor de directoare, a controllerelor și a codului de legătură pentru a eficientiza dezvoltarea aplicațiilor web. Framework-ul utilizează o abordare bazată pe transpiler pentru a produce boilerplate-ul aplicației și oferă un mediu de dezvoltare cu hot reloading și gestionarea serverului local. Permite compilarea aplicațiilor în binare unice, independente, cu suport pentru compilare cross-platform pe diferite sisteme de operare și arhitecturi. Sistemul include un motor de rutare HTTP cu rutare URI case-insensitive și injecție de dependențe scoped la nivel de cerere. De asemenea, suportă randarea conținutului pe partea de server și integrarea cu framework-uri frontend.
Automates the generation of project files and glue code to accelerate Go development.
gotests este un instrument de analiză statică și generator de boilerplate pentru Go, care creează automat suite de teste structurate din codul sursă. Funcționează ca un framework de testare bazat pe tabele (table-driven), gestionând rezoluția tipurilor pentru funcții și metode, inclusiv maparea constrângerilor de tipuri generice către tipuri de implementare concrete. Instrumentul se integrează cu modele de limbaj mari (LLM) pentru a sintetiza valori de intrare realiste și cazuri limită (edge cases) bazate pe logica funcției. Utilizează un sistem de generare bazat pe template-uri, permițând personalizarea structurii și formatului codului de test rezultat prin template-uri și parametri externi. Proiectul oferă utilitare CLI pentru scanarea recursivă a pachetelor și procesarea arborelui de directoare. Include mecanisme de control al scope-ului pentru a filtra selecția funcțiilor folosind expresii regulate și modificatori de vizibilitate.
Automatically creates structured table-driven test files and function stubs from Go source code.
Vugu este o bibliotecă și un framework UI WebAssembly pentru Go, utilizat pentru a construi aplicații single-page bazate pe componente și sigure din punct de vedere al tipurilor (type-safe). Funcționează ca un framework de componente single-file care grupează marcajele, stilurile și logica în unități modulare, utilizând un motor virtual DOM pentru a sincroniza schimbările de stare cu output-ul browserului. Proiectul dispune de un generator de componente Go care convertește șabloanele UI personalizate în cod sursă Go executabil la momentul compilării. Se distinge printr-un runtime bazat pe WebAssembly care execută logica aplicației ca un binar compilat în browser și un instrument de randurare server-side pentru a genera HTML static pentru timpi de încărcare inițială îmbunătățiți. Framework-ul acoperă o gamă largă de capabilități, inclusiv rutarea bazată pe fișiere, gestionarea ciclului de viață al componentelor și sincronizarea UI bazată pe stare. Oferă primitive pentru compunerea componentelor, gestionarea evenimentelor și legarea dinamică a datelor, susținute de un server de dezvoltare și automatizarea build-ului pentru optimizarea dimensiunii binarului.
Includes a specialized generator that converts custom UI templates into type-safe Go source code at compile time.
Acest proiect este un ghid cuprinzător de programare pentru performanță și o referință pentru limbajul Go, concentrându-se pe eficiența runtime și optimizarea memoriei. Oferă o colecție de tipare și tehnici concepute pentru a crește viteza de execuție prin reducerea overhead-ului garbage collection-ului și optimizarea utilizării memoriei. Resursa se distinge prin implementări de referință detaliate pentru optimizarea memoriei, cum ar fi escape analysis, object pooling și alinierea memoriei structurilor. Oferă strategii specifice pentru reducerea dimensiunii binarului și îmbunătățirea eficienței cache-ului CPU prin optimizarea layout-ului memoriei structurilor și utilizarea placeholder-elor cu alocare zero. Proiectul acoperă o gamă largă de capabilități de inginerie backend, inclusiv gestionarea concurenței cu worker pools și primitive de sincronizare, RPC de înaltă performanță și rutare HTTP, precum și strategii de caching distribuit. Include, de asemenea, îndrumări privind observabilitatea prin profilarea CPU și a memoriei, precum și tipare de asigurare a calității pentru unit testing funcțional și generarea de obiecte mock. Conținutul este structurat ca o serie de tutoriale, exemple arhitecturale și ghiduri de benchmarking pentru a ajuta dezvoltatorii să analizeze și să remedieze blocajele de performanță.
Ships a command-line tool to automatically generate mock implementations from Go interfaces.
dbtpl este un generator de modele de bază de date și un introspector de schemă care produce cod sursă type-safe și modele de date din schemele bazelor de date SQL. Funcționează ca un instrument de linie de comandă care mapează tipurile SQL la structuri Go și funcții de execuție, oferind în același timp un sistem bazat pe template-uri pentru crearea de cod sursă personalizat și definiții de schemă. Instrumentul suportă mai multe motoare de baze de date, inclusiv PostgreSQL, MySQL, SQLite, Oracle și SQL Server. Se distinge prin faptul că permite utilizatorilor să definească formate de output personalizate prin template-uri text și prin capacitatea de a genera definiții de model compatibile pentru framework-ul web Django. Capabilitățile sale se extind la producerea de scripturi SQL pentru migrarea și oglindirea bazelor de date, precum și la exportul reprezentărilor de schemă în formate JSON sau YAML. În plus, poate genera fișiere dot pentru a vizualiza relațiile dintre bazele de date și diagramele structurale.
Automatically generates idiomatic Go source code and type-safe data models from SQL database schemas.