Resolving the Golang plugin dependency installation failure issue in VS code
Installing github.com/nsf/gocode SUCCEEDEDInstalling github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDEDInstalling github.com/ramya-rao-a/go-outline FAILEDInstalling github.com/acroca/go-symbols FAILEDInstalling golang.org/x/tools/cmd/guru FAILEDInstalling golang.org/x/tools/cmd/gorename FAILEDInstalling github.com/fatih/gomodifytags SUCCEEDEDInstalling github.com/haya14busa/goplay/cmd/goplay SUCCEEDEDInstalling github.com/josharian/impl FAILEDInstalling github.com/rogpeppe/godef SUCCEEDEDInstalling github.com/sqs/goreturns FAILEDInstalling github.com/golang/lint/golint FAILEDInstalling github.com/cweill/gotests/... FAILEDInstalling github.com/derekparker/delve/cmd/dlv SUCCEEDED8 tools failed to install.
may be due to network problems, and I may not be the same here, but it doesn't matter, according to the following methods can be installed.
Download failed because these plugins are github
then downloaded directly from golang
the official website, but due to domestic fq restrictions, resulting in a download failure. The following methods can be installed to solve this problem.
Steps:
1. %GOPATH%\src\
under directory, create a golang.org
folder, and then create a new X folder. Directory is " %GOPATH\src\golang.org\x\
"
2. Go to the directory %GOPATH\src\golang.org\x\
and start downloading the plugin package:
git clone https://github.com/golang/tools.git tools
3. After downloading, %GOPATH\src\golang.org\x\
there is a tools
folder next
4. Open Vscode terminal, switch to terminal, go to " %GOPATH
" directory, execute:
go install github.com/ramya-rao-a/go-outline
Wait, install the failed plugin
Manual execution of the download failed plugin ...
Note that I github.com/sqs/goreturns
have failed to download here, then went into the github.com\sqs\goreturns
directory to see, nothing is downloaded, is empty, and then I went to GitHub to find github.com\sqs\goreturns
this plugin,
Create a folder, clone it manually, git clone https://github.com/sqs/goreturns.git
and then copy the contents to the github.com\sqs\goreturns
directory, then execute
go install github.com/sqs/goreturns
. OK, download successfully.
Through here, the way to solve the problem is more clear:
- 1. Create a Directory
%GOPATH\src\golang.org\x\
- 2. Go to the directory
%GOPATH\src\golang.org\x\
and download the plugin packagegit clone https://github.com/golang/tools.git tools
- 3. Open the Vscode terminal, switch to the terminal, enter the "
%GOPATH
" directory, manually download the plugin go install github.com/ramya-rao-a/go-outline
and so on
- 4. For the third step to download the failed plug-in, to see if it is empty, empty directly to the
github
top clone
down, copy the content to github.com
the following corresponding plug-in directory, and then go install
. For example:go install github.com/ramya-rao-a/go-outline
All the plugins here have been installed successfully ...