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
Release: 2024-12-14 06:07:10
Original
976 people have browsed it

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
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template