1.国内go安装包mirror
https://studygolang.com/dl
2.创建文件夹
mkdir -p ~/go/src ~/go/bin ~/go/pkg
echo 'export GOPATH=~/go' >> ~/.bash_profile && source ~/.bash_profile
3.国内go get镜像源
export GO111MODULE=on
export GOPROXY=https://goproxy.io
4.安装vscode需要开发包
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/stamblerre/gocode
go get -u -v github.com/go-delve/delve/cmd/dlv
有疑问加站长微信联系(非本文作者)