2020-05-08 13:40:17 +01:00
|
|
|
# go env
|
|
|
|
|
2020-05-11 05:03:05 +01:00
|
|
|
> Manage environment variables used by the Go toolchain.
|
|
|
|
> More information: <https://golang.org/cmd/go/#hdr-Print_Go_environment_information>.
|
2020-05-08 13:40:17 +01:00
|
|
|
|
2020-05-11 05:03:05 +01:00
|
|
|
- Show all environment variables:
|
2020-05-08 13:40:17 +01:00
|
|
|
|
|
|
|
`go env`
|
|
|
|
|
2020-05-14 17:01:50 +01:00
|
|
|
- Show a specific environment variable:
|
2020-05-08 13:40:17 +01:00
|
|
|
|
|
|
|
`go env {{GOPATH}}`
|
|
|
|
|
2020-05-14 17:01:50 +01:00
|
|
|
- Set an environment variable to a value:
|
2020-05-08 13:40:17 +01:00
|
|
|
|
2020-05-11 05:03:05 +01:00
|
|
|
`go env -w {{GOBIN}}={{path/to/directory}}`
|
|
|
|
|
2020-05-14 17:01:50 +01:00
|
|
|
- Reset an environment variable's value:
|
2020-05-11 05:03:05 +01:00
|
|
|
|
|
|
|
`go env -u {{GOBIN}}`
|