This is an example of a highly flexible generator from my code generation toolbox.
This bundles all the toolbox generators into a single configurable entry point. You have to configure everything to make it work. The config file looks like this:
packages {
["github.com/you/project"] {
chainer {
// exactly like go-chainer-gen options
}
composer {
// exactly like go-composer-gen options
}
stringer {
// exactly like go-stringer-gen options
}
}
}This generator requires the pkl binary to be available on your PATH. It is used at runtime to evaluate .pkl
configuration files. You can install it via:
# macOS
brew install pklFor other platforms, see pkl-lang installation docs.
Clone the repository and run
# runs the generator against the included example project
go run ./main.go -w ./example
# runs the generator in dry-run mode against the included example project
go run ./main.go --dry-run -w ./examplePRs are welcome! Distributed under the Apache License 2.0.
If you like the project, feel free to buy me a coffee. Thank you!