原因是 Go 插件需要的命令行工具依赖 golang.orgxtools 这个库,
而这个库是存放在 https://go.googlesource.com/tools 上的,
因为是 google 的东西,所以…万恶的墙。
知道原因后,有两种解决方法(要么FQ,要么通过github下载对应镜像)。
下面我们就说说怎么通过github解决这个问题:
go get -u -v github.com/josharian/impl
go get -u -v github.com/mdempsky/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-find-references
go get -u -v github.com/lukehoban/go-outline
go get -u -v github.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 -v -u github.com/peterh/liner github.com/derekparker/delve/cmd/dlv
go get -u -v golang.org/x/tools/cmd/guru
由于被墙和依赖的缘故,很多插件是没办法正常安装的,但是go官方在github是有镜像仓库的,所以我们可以借助github来安装。
srcgolang.org\x\
git clone https://github.com/golang/tools.git
git clone https://github.com/golang/mod.git
git clone https://github.com/golang/xerrors.git
git clone https://github.com/golang/lint.git
toolsmodxerrorslint
toolsmodxerrorslint
%GOPATH%
go install github.com/mdempsky/gocode
go install github.com/rogpeppe/godef
go install github.com/lukehoban/go-find-references
go install github.com/lukehoban/go-outline
go install github.com/sqs/goreturns
go install golang.org/x/tools/cmd/gorename
go install github.com/tpng/gopkgs
go install github.com/josharian/impl
go install github.com/newhook/go-symbols
go install golang.org/x/tools/cmd/guru
go install golang.org/x/lint/golint
到此结束。。。。