LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

go-env

print and manage Go environment variables

TLDR

Print all Go environment variables
$ go env
copy
Print specific variable
$ go env GOPATH
copy
Print multiple variables
$ go env GOROOT GOPATH GOBIN
copy
Set a variable persistently
$ go env -w GOBIN=[/path/to/bin]
copy
Unset a variable
$ go env -u GOBIN
copy
Print as JSON
$ go env -json
copy

SYNOPSIS

go env [-json] [-u var] [-w var=value] [var ...]

DESCRIPTION

go env prints Go environment information. Without arguments, it prints all known environment variables. With arguments, it prints the values of the named variables. The -w flag writes values to the go/env file, making them persistent across sessions. The -u flag removes variables from go/env.

PARAMETERS

-json

Print environment in JSON format.
-w var=value
Set variable persistently in go/env file.
-u var
Unset variable from go/env file.

CONFIGURATION

$HOME/.config/go/env

Persistent Go environment variable file managed by go env -w.

CAVEATS

Variables set with -w take precedence over shell environment variables. The go/env file is typically located at $HOME/.config/go/env.

SEE ALSO

go(1), go-build(1), go-mod(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid