到官方https://golang.org/dl/下載安裝包
wget https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz
解壓
tar zxvf go1.8.linux-amd64.tar.gz -C /usr/local
新建go項(xiàng)目根目錄
mkdir -p /var/opt/wwwroot/goblog
配置環(huán)境變量
vim /etc/profile
export GOROOT=/usr/local/go
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
export GOPATH=/var/opt/wwwroot/goblin
source /etc/profile
安裝結(jié)束单寂,驗(yàn)證
go version
go調(diào)試
dlv debug --headless --listen=:8030 --api-version=2