Adding Go to Your PATH
Your shell finds a command by walking the directories in $PATH. Two Go-related directories need to be on it, for two different reasons.
The toolchain itself. If go version worked in the last module, this is already done — your package manager handled it. If you unpacked the tarball from go.dev/dl by hand, it lives in /usr/local/go and nothing has told your shell yet.
Binaries that go install produces. This is the one that bites. go install compiles a command-line tool and puts it in $GOPATH/bin — ~/go/bin unless you've changed it. If that's not on your PATH, the install reports success and the very next line says command not found. You'll install two tools in this module, so fix it now.
go env GOROOT # where the toolchain itself lives
go env GOPATH # the root `go install` puts binaries under (default: ~/go)Add both to your shell's startup file — ~/.zshrc on macOS, ~/.bashrc on most Linux setups:
export PATH="$PATH:/usr/local/go/bin" # only needed for a tarball install
export PATH="$PATH:$HOME/go/bin" # where `go install` puts binariesOpen a new terminal (or source ~/.zshrc), then confirm with which go.
Coming from Python, go install is roughly pipx install: it puts a standalone tool on your PATH globally, not into a per-project environment. ~/go/bin is Go's ~/.local/bin.