1,下载二进制文件:
2,解压并创建工作目录:
tar -zxf goVersion.linux-amd64.tar.gz -C /usr/local/
mkdir /go
3,设置环境变量:
export GOROOT=/usr/local/go
export GOBIN=$GOROOT/bin
export GOPKG=$GOROOT/pkg/tool/linux_amd64
export GOARCH=amd64
export GOOS=linux
export GOPATH=/go
export PATH=$PATH:$GOBIN:$GOPKG:$GOPATH/bin
4,重载配置 source /etc/profile 使之生效,或者重新登录Linux也可