Installation

Generating code requires gohandlers command to be installed. To stamp the generated files with the version number, clone the repository and use the Makefile recipe to install:

cd "$(mktemp -d)"
git clone https://github.com/ufukty/gohandlers
cd gohandlers
make install

If you don’t mind the generated files miss the version number you can use go command as well:

go install github.com/ufukty/gohandlers@latest

Either way you need to make sure you installed the binary onto a PATH accessible location. If so this command should print at least one line of binary locations:

which -a gohandlers

You also need the get the gohandlers package provided by the same repository. Switch to the directory of your project’s module root and get the package. Don’t forget to run vendor your dependencies if you enabled it previously:

go get github.com/ufukty/gohandlers/pkg/gohandlers
# go mod vendor

Usage

The general syntax of the tool is:

gohandlers [command] [flags]

Run this to see available flags for each subcommand:

gohandlers [command] -help