Files
cheatsheet-tldr/tldr/go-env
2025-06-29 00:23:20 +00:00

26 lines
506 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# go env
> Manage environment variables used by the Go toolchain.
> More information: <https://pkg.go.dev/cmd/go#hdr-Print_Go_environment_information>.
- Show all environment variables:
`go env`
- Show a specific environment variable:
`go env {{GOPATH}}`
- Set an environment variable to a value:
`go env -w {{GOBIN}}={{path/to/directory}}`
- Reset an environment variable's value:
`go env -u {{GOBIN}}`