gen

command
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Readme for Codegen

This internal module contains code generation for producing a few repetitive constructs, namely:

  • The switch statement that handles the request dispatch
  • The hook function types and the methods on the Hook struct

To invoke the code generation:

go generate ./...

Development

  • request_handler.go.tmpl generates server/request_handler.go, and
  • hooks.go.tmpl generates server/hooks.go

Inside of data.go there is a struct with the inputs to both templates.

Note that the driver in main.go generates code and also pipes it through goimports for formatting and imports cleanup.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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