我用下面这条命令设置 GOPATH 路径
export GOPATH=$HOME/go
能生效,但是每次重新开终端执行 go get
命令又提示,为什么呢?
package xxx: cannot download, $GOPATH not set. For more details see: go help gopath
bash的话,配置到.profile或者.bashrc
zsh的话,配置到.zshrc
将export写到~/.profile中,重开终端执行. ~/.profile