vscode中安装ms-vscode.go插件后可以开启对go语言的支持,ms-vscode.go插件需要依赖一些工具,安装完成后提示
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 sourcegraph.com/sqs/goreturns FAILEDInstalling golang.org/x/lint/golint FAILEDInstalling github.com/cweill/gotests/... FAILEDInstalling github.com/derekparker/delve/cmd/dlv SUCCEEDED 8 tools failed to install.
由于网络原因,一些依赖工具无法正常安装,需要进行手动安装.
以下为手动安装的工具的步骤:
- 在%GOPATH%\src\目录下,建立路径golang.org\x
- 进入到%GOPATH%\src\golang.org\x,下载需要工具的源码git clone https://github.com/golang/tools.git tools
- clone完成后,会生成一个tools文件夹,这样工具所需要的源码已经准备好了
- 进入到%GOPATH%下,执行
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/rogpeppe/godef? go install github.com/sqs/goreturns? go install github.com/cweill/gotests/gotests
- 单独处理golint,golint的源码位于https://github.com/golang/lint,进入%GOPATH%\src\golang.org\x后执行git clone https://github.com/golang/lint下载golint需要的源码
- 进入到%GOPATH%下,执行go install github.com/golang/lint/golint
原文地址:https://www.cnblogs.com/tingguoguoyo/p/10690160.html
时间: 2024-11-01 12:21:23