环境变量
vim /etc/profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/<your gopath>
export PATH=$PATH:$GOROOT/bin
source /etc/profile
或者重启
Go插件
cd $GOPATH
git clone git@github.com:golang/tools.git
mkdir -p $GOPATH/src/golang.org/x //路径下创建此文件
cd $GOPATH/src/golang.org/x //切换到此目录
git clone https://github.com/golang/tools.git //通过git安装 tools
git clone https://github.com/golang/lint.git //安装 lint
go get golang.org/x/lint/golint //然后执行
go install github.com/golang/lint/golint
go install github.com/ramya-rao-a/go-outline
go install github.com/acroca/go-symbols
go install golang.org/x/tools/cmd/guru
go install golang.org/x/tools/cmd/gorename
go install github.com/mdempsky/gocode
网友评论