๐File Structure
Before we dive right into corgi's syntax, let's talk about where to put all your files.
Conventionally, corgi files live right in the package that they are used in. Do note, however, that this pattern isn't a fit-for-all and depending on your situation you may want to place your templates elsewhere. See this as guidance if you're unsure where to put your templates.
To generate functions from your templates, place a go:generate directive somewhere in the package that executes the corgi command on the template file.
//go:generate corgi my_template.corgiYou can install corgi with go install:
go install github.com/mavolin/corgi/cmd/corgi@latestLast updated
Was this helpful?