1.下载go1.8.linux-amd64.tar.gz
2.安装go1.8
tar -zxvf go1.8.linux-amd64.tar.gz
sudo mv go /usr/share/go
mkdir -p ~/go/bin
mkdir -p ~/go/src
3.配置环境变量
vim ~/.profile
export GOROOT=/usr/share/go
export PATH="$PATH:$GOROOT/bin"
export GOPATH=$HOME/go
export PATH="$PATH:$GOPATH/bin"
#保存退出
4.测试
go version
网友评论