linux設置環境變量GOPATH

vim /etc/profile

export GOROOT=/usr/local/go  #設置爲go安裝的路徑,有些安裝包會自動設置默認的goroot
export GOPATH=$PATH:/root/go   #默認安裝包的路徑
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

source /etc/profile
相關文章
相關標籤/搜索