环境变量
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
把tools文件夹底下的lint文件夹分别放入%GOPATH%/src/golang/x 和 %GOPATH%/src/github.com/ 如下目录结构所示:
src
├── github.com
| └── golang
| └── lint
| ...
└── golang.org
└── x
├── tools
└── lint
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
有疑问加站长微信联系(非本文作者)