ubuntu安装go语言
1.下载安装包
2.解压
sudo tar -zvxf go1.10.linux-amd64.tar.gz -C /usr/local
3.配置
sudo vim /etc/profile
添加
#set Go environment
export GOROOT=/usr/local/go #设置为go安装的路径
export GOPATH=$HOME/gocode #gocode的路径
export PATH=$PATH:$GOROOT/bin:$GOPATH
4.重新读取配置
source /etc/profile
5.查看版本
jiqing@ThinkPad:/usr/local$ go version
go version go1.10 linux/amd64