栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Go语言

解决:使用VS开发Go时,Go扩展安装失败

Go语言 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

解决:使用VS开发Go时,Go扩展安装失败

报错信息
Installing github.com/nsf/gocode FAILED
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 FAILED
...
解决过程

官方Go模块代理说明链接点此处跳转Github

其中在Windows下
打开cmd,依次输入下面语句:

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

在macOS或Linux下
打开终端,依次输入下面语句:

export GO111MODULE=on
export GOPROXY=https://goproxy.cn

或

echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
source ~/.profile
回到VS code,成功安装所有扩展
Tools environment: GOPATH=C:Usersmacgo
Installing 10 tools at C:Usersmacgobin in module mode.
  gopkgs
  go-outline
  gotests
  gomodifytags
  impl
  goplay
  dlv
  dlv-dap
  staticcheck
  gopls

Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs (C:Usersmacgobingopkgs.exe) SUCCEEDED
Installing github.com/ramya-rao-a/go-outline (C:Usersmacgobingo-outline.exe) SUCCEEDED
Installing github.com/cweill/gotests/gotests (C:Usersmacgobingotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags (C:Usersmacgobingomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl (C:Usersmacgobinimpl.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay (C:Usersmacgobingoplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv (C:Usersmacgobindlv.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@master (C:Usersmacgobindlv-dap.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck (C:Usersmacgobinstaticcheck.exe) SUCCEEDED
Installing golang.org/x/tools/gopls (C:Usersmacgobingopls.exe) SUCCEEDED

All tools successfully installed. You are ready to Go :).

欢迎一键三连~~ 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/906011.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号