Skip to main content
Version: 2.25 (dev)

go-generate


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.debug_goals

Config section: [go-generate]

Basic options

None

Advanced options

env_vars

--go-generate-env-vars="['<str>', '<str>', ...]"
PANTS_GO_GENERATE_ENV_VARS
pants.toml
[go-generate]
env_vars = [
'<str>',
'<str>',
...,
]
default:
[
  "LANG",
  "LC_CTYPE",
  "LC_ALL",
  "PATH"
]

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 fieldgo_generate_env_vars on local_environment, docker_environment, or remote_environmenttargets.

Deprecated options

None