centos7安装golang

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也可

posted @ 2017-10-26 09:30  王东波  阅读(128)  评论(0编辑  收藏