1:下载
wget http://www.golangtc.com/static/go/go1.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.3.linux-amd64.tar.gz
2:配置环境变量
vim /etc/profile
添加两行
export GOROOT=/usr/local/go export PATH=$GOROOT/bin:$PATH
source /etc/profile
3 测试安装是否成功
[root@AY140215180633785252Z go]# go version go version go1.3 linux/amd64
4 运行
vim hello_world.go
package main func main(){ print("hello,world "); }
go run hello_world.go
[root@AY140215180633785252Z go]# go run hello_world.go
hello,world