【IDE环境】Go 1.6.3 On CentOS 6.8
1.获取Go源码包
[thomaschen@localhost Downloads]$ get https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
2.解压源码包
[thomaschen@localhost Downloads]$ su Password: [root@localhost Downloads]#tar -zxvf go1.6.3.linux-amd64.tar.gz -C /usr/local
3.设置环境变量。编辑/etc/profile文件,其后追加如下内容
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/go
执行如下命令,使得环境变量生效
[root@localhost Downloads]# source /etc/profile
4. 测试
[root@localhost local]# go version go version go1.6.3 linux/amd64
浙公网安备 33010602011771号