Skip to content

Introduction to Go workspaces

New Course Coming Soon:

Get Really Good at Git

One special thing about Go is what we call 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](https://pkg.go.dev/golang.org/x/tools/gopls) command, the Delve debugger (dlv) and the [staticcheck linter](https://staticcheck.io/).

They were automatically installed under $HOME/go:

Screen Shot 2022-07-28 at 12.27.27.png

When you will 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.

Are you intimidated by Git? Can’t figure out merge vs rebase? Are you afraid of screwing up something any time you have to do something in Git? Do you rely on ChatGPT or random people’s answer on StackOverflow to fix your problems? Your coworkers are tired of explaining Git to you all the time? Git is something we all need to use, but few of us really master it. I created this course to improve your Git (and GitHub) knowledge at a radical level. A course that helps you feel less frustrated with Git. Launching Summer 2024. Join the waiting list!
→ Get my Go Handbook

Here is how can I help you: