pants go-generate [args]

Run each command in a package described by a //go:generate directive. This is equivalent to running go generate on a Go package.

Note: Just like with go generate, the go-generate goal is never run as part of the build and must be run manually to invoke the commands described by the //go:generate directives.

See https://go.dev/blog/generate for details.

Backend: pants.backend.experimental.go
Config section: [go-generate]

Basic options


Advanced options


--go-generate-env-vars="['<str>', '<str>', ...]"



Environment variables to set when invoking generator programs. Entries are either strings in the form ENV_VAR=value to set an explicit value; or just ENV_VAR to copy the value from Pants's own environment.

Can be overriden by field go_generate_env_vars on local_environment, docker_environment, or remote_environment targets.

Deprecated options


Related subsystems

environments-preview, filter, golang