GOPATH, GOROOT, GOBIN

suggest change

GOPATH

Modules allow source code to live outside GOPATH. When unset, GOPATH defaults to $HOME/go on Unix-like systems and %USERPROFILE%\go on Windows.

Current Go commands primarily use it for:

Inspect the effective value with go env GOPATH. Most projects should not set it explicitly.

GOBIN

GOBIN optionally selects the directory where go install writes executable commands. When it is unset, Go uses the bin directory under the first GOPATH entry. Add that directory to the operating system's PATH if you want to invoke installed commands by name.

GOROOT

GOROOT is the Go toolchain installation directory and contains the standard library source and toolchain files. The Go distribution normally determines it automatically; users rarely need to set it.

See go env for the full environment.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents