GOPATH

The Go setting that names a folder, by default go in your home folder, where downloaded modules are cached and installed tools are placed.

In more detail

go install writes binaries to the bin folder under GOPATH (or to GOBIN if set). Add that folder to your PATH once so installed tools run by name. With modules you no longer have to keep your own code inside GOPATH.

Example

export PATH="$PATH:$(go env GOPATH)/bin"

Related terms

Taught in

References