Skip to content
forked from dbreedt/gener8

simple golang go:generate code generator

License

Notifications You must be signed in to change notification settings

getkalido/gener8

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gener8

simple golang go:generate code generator

install

go get github.com/dbreedt/gener8

supported parameters

skip_format: skip gofmt being run on the generated file
trace      : enables trace logging
in         : file to parse
out        : file to write the generated code to
pkg        : the value to replace $pkg with
kws        : csv list of values to replace $kwn tokens with

usage

Create a file with markers

  • $pkg
  • $kwn where n is a numeric value starting from 1

Then add a go:generate comment to your codebase

//go:generate gener8 -in=make.me -out=made.go -pkg=made -kws=test,tPtr

or just run it from the cmdline:

gener8 -in=make.me -out=made.go -pkg=made -kws=test,tPtr

In these examples $kw1 will be replaced with test and $kw2 will be replaced with tPtr

About

simple golang go:generate code generator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%