安装完go之后,在vs code安装相关插件的时候,需要下载依赖包,下载失败。
![9887d290d35c90c75329455026b0e15a.png](https://i-blog.csdnimg.cn/blog_migrate/2e3897e817fe7f11e93f7a472f9be60c.jpeg)
图1.1
提示类似下面的信息,设置一下代理即可。
// 错误提示Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs FAILEDInstalling github.com/acroca/go-symbols FAILEDInstalling github.com/haya14busa/goplay/cmd/goplay FAILEDInstalling github.com/godoctor/godoctor FAILEDInstalling github.com/stamblerre/gocode FAILEDInstalling github.com/rogpeppe/godef FAILEDInstalling github.com/sqs/goreturns FAILED
// Go 1.13+ 默认启用, 可以不用设置go env -w GO111MODULE=on// 设置代理go env -w GOPROXY=https://goproxy.io,direct
重启vs code之后,再次执行安装,就正常了
Installing github.com/mdempsky/gocode (xxgocode.exe) SUCCEEDEDInstalling github.com/uudashr/gopkgs/v2/cmd/gopkgs (xxxgopkgs.exe) SUCCEEDEDInstalling github.com/ramya-rao-a/go-outline (xxxgo-outline.exe) SUCCEEDEDInstalling github.com/acroca/go-symbols (xxxgo-symbols.exe) SUCCEEDEDInstalling golang.org/x/tools/cmd/guru (xxxguru.exe) SUCCEEDED……