Home >Backend Development >Golang >Why Doesn't My Mac Find the 'go' Command After Go Installation?

Why Doesn't My Mac Find the 'go' Command After Go Installation?

Patricia Arquette
Patricia ArquetteOriginal
2024-12-14 06:07:101046browse

Why Doesn't My Mac Find the

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn