解决vs code中golang插件依赖安装失败问题

Installing github.com/nsf/gocode SUCCEEDED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing github.com/fatih/gomodifytags SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED
Installing github.com/josharian/impl FAILED
Installing github.com/rogpeppe/godef SUCCEEDED
Installing github.com/sqs/goreturns FAILED
Installing github.com/golang/lint/golint FAILED
Installing github.com/cweill/gotests/... FAILED Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED 8 tools failed to install.

可能由于网络问题,可能和我这里不太一样,但是没关系,按下面的办法都可以安装的.

githubgolang

步骤:

%GOPATH%\src\golang.org%GOPATH\src\golang.org\x\%GOPATH\src\golang.org\x\git clone https://github.com/golang/tools.git tools%GOPATH\src\golang.org\x\tools%GOPATHgo install github.com/ramya-rao-a/go-outline

一个个手动的执行下载失败的插件...

github.com/sqs/goreturnsgithub.com\sqs\goreturnsgithub.com\sqs\goreturnsgit clone https://github.com/sqs/goreturns.gitgithub.com\sqs\goreturnsgo install github.com/sqs/goreturns

通过这里, 解决问题的思路比较清晰了:

%GOPATH\src\golang.org\x\%GOPATH\src\golang.org\x\git clone https://github.com/golang/tools.git tools%GOPATHgo install github.com/ramya-rao-a/go-outlinegithubclonegithub.comgo installgo install github.com/ramya-rao-a/go-outline
到这里全部的插件就安装成功了...