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

Projects
None yet
2 participants
@AZmake
Copy link

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

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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 Mar 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.