Issue
I feel like an idiot because I've installed this before on macOS and OSX but for some reason I can't see what I'm doing wrong. Please help!!! I've created a directory, ~/go
, which will be my workspace. When I run go env
from my home directory I get zsh: command not found: go
and I know it's because of the following files. What is wrong in my configuration?
~/.bash_profile:
export PATH=$PATH:/usr/local/go/bin
~/.zshrc:
export PATH=$PATH:/usr/local/go/bin
Solution
If you installed on Mac OS not with home-brew but with the macOS package installer, your GOBIN be in /usr/local/go and GOPATH in $HOME/go, finally in ~/.zshrc
:
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOROOT/bin
Answered By - Sergii Getman Answer Checked By - Senaida (WPSolving Volunteer)