Categorygithub.com/getkalido/gener8
repositorypackage
0.0.0-20200910070520-005d9583c30b
Repository: https://github.com/getkalido/gener8.git
Documentation: pkg.go.dev

# README

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