这篇文章主要讲解了“vscode安装go插件失败如何解决”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“vscode安装go插件失败如何解决”吧!
下载go1.14.6.windows-amd64.msi
安装即可,安装路径选择默认,安装完成后会自动帮你配置环境变量
不用自己配置了
打开cmd,查看是否安装完成
这样就代表已经成功安装了
vscode会提示你安装go插件
点击install all
这时候会安装失败
Installing github.com/mdempsky/gocode FAILED
Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs FAILED
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/cweill/gotests/… FAILED
Installing github.com/fatih/gomodifytags FAILED
Installing github.com/josharian/impl FAILED
Installing github.com/davidrjenni/reftools/cmd/fillstruct FAILED
Installing github.com/haya14busa/goplay/cmd/goplay FAILED
Installing github.com/godoctor/godoctor FAILED
Installing github.com/go-delve/delve/cmd/dlv FAILED
Installing github.com/stamblerre/gocode FAILED
Installing github.com/rogpeppe/godef FAILED
Installing github.com/sqs/goreturns FAILED
Installing golang.org/x/lint/golint FAILED
原因你懂的
https://goproxy.io是一个国内的代理
执行
# 旧版,已废弃 go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.io,direct
# 新版改成如下链接 go env -w GO111MODULE=on go env -w GOPROXY=https://proxy.golang.com.cn,direct
关闭vscode重新打开,再次点击install all
成功安装
开启go mod 代理后也可以手动安装
go get -u -v github.com/mdempsky/gocode go get -u -v github.com/uudashr/gopkgs/v2/cmd/gopkgs go get -u -v github.com/ramya-rao-a/go-outline go get -u -v github.com/acroca/go-symbols go get -u -v golang.org/x/tools/cmd/guru go get -u -v golang.org/x/tools/cmd/gorename go get -u -v github.com/cweill/gotests/... go get -u -v github.com/fatih/gomodifytags go get -u -v github.com/josharian/impl go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct go get -u -v github.com/haya14busa/goplay/cmd/goplay go get -u -v github.com/godoctor/godoctor go get -u -v github.com/go-delve/delve/cmd/dlv go get -u -v github.com/stamblerre/gocode go get -u -v github.com/rogpeppe/godef go get -u -v github.com/sqs/goreturns go get -u -v golang.org/x/lint/golint
如图
感谢各位的阅读,以上就是“vscode安装go插件失败如何解决”的内容了,经过本文的学习后,相信大家对vscode安装go插件失败如何解决这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。