go generate executes source-code generation commands written in comments using the //go:generate directive. It turns generation into a repeatable project operation instead of an undocumented terminal command. section 10.8 section 10.1.2
For a gRPC API, place a directive in a generate.go file and invoke protoc against the .proto files. Keep the command documented so future maintainers can reproduce the generated files. section 10.1.2
Generate gRPC sources
//go:generate bash -c "protoc -I=api/proto/ ... api/proto/*.proto" A shell wrapper matters when the command uses *.proto: go generate does not expand that wildcard itself. A Makefile or script is an alternative when the command is easier to maintain there. section 10.1.2

