Skip to content
/ gengen Public

Little go:generate tool for quick "generics" (using templates)

License

Notifications You must be signed in to change notification settings

trapped/gengen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gengen

Little go:generate tool for quick "generics" (using templates).

Usage

Usage of gengen:
  -d string
        Directory to parse files from
  -o string
        Output filename
  -t string
        Template to render

Example go generate directive (taken from gomaild2):

//go:generate gengen -d ./commands/ -t process.go.tmpl -o process.go

gengen parses a directory (-d) for Go code, then renders your template (-t) exposing the parsed data as .Packages (map[name string]*ast.Package). This helps reduce "pseudo-generic" boilerplate code, such as monolithic switch statements (see gomaild2's SMTP command processor).

About

Little go:generate tool for quick "generics" (using templates)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages