Error Encountered: Command "go" Not Found on Mac Post-Installation
This inquiry delves into an issue faced by Mac users after installing Go: the terminal command "go version" yields the error "command not found: go." Even after setting the path variable in the bash profile "/usr/local/go/bin," the error persists.
Resolution
As suggested by bjhaid in the comments, the root cause lies in the need to update the PATH variable within the "~/.zshrc" file. Specifically, add the following lines to "~/.zshrc":
export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:$GOPATH/bin
Subsequently, source the "~/.zshrc" file with the command ". ~/.zshrc." This modification should rectify the issue encountered.
The above is the detailed content of Why Doesn't My Mac Find the 'go' Command After Go Installation?. For more information, please follow other related articles on the PHP Chinese website!