What does the built-in generate command of the Go compiler do?
generate
It has subcommands mocks and tests to generate relevant .go source files. Generate Go files by processing source
mocks
tests
.go
It provides subcommands sql, json, yaml, and switches --schema and --objects to generate relevant code.
sql
json
yaml
--schema
--objects
It looks for files with names that end with _generate.go, and then compiles and runs each of these files individually.
_generate.go
It scans the projects source code looking for //go:generate comments, and for each such comment runs the terminal command it specifies.
//go:generate