Home >Backend Development >Golang >Why Doesn't My Mac Recognize the `go` Command After Go Installation?
Upon installing Go and attempting to run the "go version" command, many users encounter the error message "zsh: command not found: go." This can be frustrating, especially after trying multiple solutions like adding the path to the bash profile and reinstalling Go.
To resolve this issue, adding the path to "~/.zshrc" is necessary.
In the "~/.zshrc" file, add these lines:
export PATH=$PATH:/usr/local/go/bin export PATH=$PATH:$GOPATH/bin
Then, source the "~/.zshrc" file:
. ~/.zshrc
Following these steps ensures that the path is properly added to the user's profile, allowing the "go" command to be recognized and executed.
The above is the detailed content of Why Doesn't My Mac Recognize the `go` Command After Go Installation?. For more information, please follow other related articles on the PHP Chinese website!