golang环境安装
到官方https://golang.org/dl/下载安装包
cd /usr/local/src wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
解压:
tar zxvf go1.8.linux-amd64.tar.gz -C /usr/local
新建go项目根目录:
mkdir -p /data/golang
配置环境变量:
vim /etc/profile export GOROOT=/usr/local/go export GOBIN=$GOROOT/bin export PATH=$PATH:$GOBIN export GOPATH=/var/opt/wwwroot/goblog source /etc/profile
安装结束,验证:
go version