codegen

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

README

codegen

Tests Coverage CI vuln scan CodeQL

Release CodeFactor Grade License

GoDoc Discord Channel go version Top language Commits since latest release


Tools to generate and test golang code.

Announcements

  • 2026-06-22 : new community chat on discord
    • a new discord community channel is available to be notified of changes and support users

You may join the discord community by clicking the invite link on the discord badge (also above). Discord Channel

Status

Work in progress.

Import this library in your project

go get github.com/go-openapi/codegen/{module}

Contents

go-openapi/codegen exposes a collection of code generation tools and utilities.

  • formatting: go code formatting, including imports resolution and go.mod formatting
  • funcmaps: useful pre-assembled funcmaps
  • genapp: a composable app-generator to build clean, formatted go code
  • gentesting: tools to test generated code from their behavior and desired properties
  • mangling: name mangling utilities to produce clean go identifiers
  • templates-repo: a repository to cache templates with a unified namespace

Dependencies

The root module github.com/go-openapi/codegen at the repo level maintains a few dependencies outside of the standard library.

TBD


Note to contributors

All kinds of contributions are welcome.

This repo is a go mono-repo.

More general guidelines are available here.

Roadmap

TODO

Change log

See https://github.com/go-openapi/codegen/releases

Licensing

This library ships under the SPDX-License-Identifier: Apache-2.0.

Cutting a new release

Maintainers can cut a new release by running:

Documentation

Overview

Package codegen exposes utilities to build and test code generators that build go apps.

Directories

Path Synopsis
Package formatting formats generated Go source.
Package formatting formats generated Go source.
internal/rules
Package rules holds the formatting rules an enable module registers.
Package rules holds the formatting rules an enable module registers.
internal/std
Package std answers which name a standard library import declares.
Package std answers which name a standard library import declares.
resolve
Package resolve reads the name each imported package declares.
Package resolve reads the name each imported package declares.
Package funcmaps exposes utilities to work with template.FuncMap.
Package funcmaps exposes utilities to work with template.FuncMap.
golang
Package golang provides the Go-specific template function map used by code generators.
Package golang provides the Go-specific template function map used by code generators.
Package genapp renders templates into formatted Go files.
Package genapp renders templates into formatted Go files.
Package gentesting provides test utilities for code generation.
Package gentesting provides test utilities for code generation.
mangling module
Package repo compiles a set of Go text templates into an immutable repository.
Package repo compiles a set of Go text templates into an immutable repository.
internal/cover
Package cover measures which lines of a template a program reaches when it runs.
Package cover measures which lines of a template a program reaches when it runs.
internal/document
Package document analyses template sources, rather than compiling them.
Package document analyses template sources, rather than compiling them.
reports
Package reports holds what a templates repository says about itself.
Package reports holds what a templates repository says about itself.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL