
The Go workspace
The Go workspace ź“ė Ø
One special thing about Go is what we call the workspace.
The workspace is the āhome baseā for Go.
By default Go picks the $HOME/go
path, so you will see a go
folder in your home.
Itās first created when you install a package (as weāll see later) but also to store some tooling.
For example the moment I loaded the hello.go
file in VS Code, it prompted me to install the gopls
command, the Delve debugger (dlv
), and the staticcheck
linter.
They were automatically installed under $HOME/go
:

$HOME/go
When you install packages using go install
, they will be stored here.
This is what we call GOPATH.
You can change the GOPATH
environment variable to change where Go should install packages.
This is useful when working on different projects at the same time and you want to isolate the libraries you use.