Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go version shows command not found, when I install go by go1.12.darwin-amd64.pkg or go1.11.5.darwin-amd64.pkg #30762

Closed
AZmake opened this issue Mar 12, 2019 · 4 comments

Comments

@AZmake
Copy link

AZmake commented Mar 12, 2019

go version:
go1.11.5.darwin-amd64.pkg or go1.12.darwin-amd64.pkg

OS:
macOS Mojave 10.14.3

I install go by go1.12.darwin-amd64.pkg or go1.11.5.darwin-amd64.pkg.

1、 I type go version in mac terminal, it shows -bash: go: command not found.

2、I type echo $PATH, there isn't go path like /usr/local/go/bin, but the /etc/paths.d/go is found.

3、 I type cd /usr/local/go/bin and ./go version, this shows go version.

4、I set the go path export PATH=$PATH:/usr/local/go/bin in .bash_profile and source .bash_profile, and then I exec steps ,shows -bash: go: command not found .

So, what's wrong whit me?

@agnivade
Copy link
Contributor

Did you follow the steps here (https://golang.org/doc/install#macos) exactly ?

The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.

including this one ?

@AZmake
Copy link
Author

AZmake commented Mar 12, 2019

In fact, I don't need to add the go path to my PATH environment variable,because the pkg package had auto add it in /etc/paths.d, and OS will load it when I restart OS. But it takes something wrong here.

Steps 4, I had add it and restart terminal, but go version shows command not found

@AZmake
Copy link
Author

AZmake commented Mar 12, 2019

It's a new os, I just formatted hard disk and install it.

My another computer is update os from 10.14 to 10.14.3, go version shows version info, It looks good

@AZmake
Copy link
Author

AZmake commented Mar 12, 2019

Sorry, I don't know what's wrong, when I takes export PATH=$PATH:/usr/local/go/bin to the end of the .bash_profile and kill the terminal , go version shows version info, It looks good.

thanks for your help.

@AZmake AZmake closed this as completed Mar 12, 2019
@golang golang locked and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants