Thanks to visit codestin.com
Credit goes to pkg.go.dev

gen

command
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: MIT Imports: 9 Imported by: 0

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