官网:

You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):

export PATH=$PATH:/usr/local/go/bin

这是go本身的bin file,还需要添加go install的bin。 install的目的在用户文件夹,可以这样获取:

go env GOPATH

所以在用户文件夹的shell配置文件比如.bashrc添加这行

export PATH="$PATH:$(go env GOPATH)/bin

问题就解决了

Views: 1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.