解决VSCode安装Go tools失败的问题

永远的零 2022-11-21 PM 580℃ 0条

安装Go后,打开VS Code,按照提示安装了微软官方的GO插件。但在安装go tools时,出现了下面的一大堆错误。

go.toolsGopath setting is not set. Using GOPATH /Users/l2m2/go
Installing 17 tools at /Users/l2m2/go/bin in module mode.
gocode
gopkgs
go-outline
go-symbols
guru
gorename
gotests
gomodifytags
impl
fillstruct
goplay
godoctor
dlv
gocode-gomod
godef
goimports
golint

解决方案
设置代理:

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

https://goproxy.io/zh/
https://github.com/microsoft/vscode-go/issues/3129

人要么永不做梦,要么梦得有趣;人也必须学会清醒:要么永不清醒,要么清醒得有趣。

评论啦~