go环境安装

go语言安装过程

1
2
3
4
5
[root@linux-node1 ~]# yum install -y gcc glibc gcc-c++ make git
[root@linux-node1 ~]# cd /usr/local/src
[root@linux-node1 ~]# wget https://storage.googleapis.com/golang/go1.6.1.linux-amd64.tar.gz
[root@linux-node1 ~]# tar zxf go1.6.1.linux-amd64.tar.gz
[root@ linux-node1 src]# mv go /usr/local/

配置环境变量

1
2
3
4
5
6
[root@ linux-node1 ~]# mkdir /usr/local/go/work/
[root@ linux-node1 ~]# vim ~/.bash_profile
export GOROOT=/usr/local/go
export GOPATH=/usr/local/go/work
PATH=$PATH:$HOME/bin:$GOROOT/bin:$GOPATH/bin
[root@linux-node1 ~]# source .bash_profile

检查安装是否正常

1
2
[root@linux-node1 ~]#go version
go version go1.6.1 linux/amd64