1. 配置好 Go 相关的环境变量,很多文章有说,这里就跳过了;

2. 参考 goproxy.io ,打开 cmd ,输入

go env -w GOPROXY=https://goproxy.io,direct
后续的 go

3. 重启 VSCode,打开任意一个 go 文件,保存,右下角会提示安装依赖,选择安装全部;

4. 等待安装完成,在OUTPUT窗口会有相应的信息输出

Tools environment: GOPATH=D:/Software/Go/GOPATH
Installing 12 tools at D:\Software\Go\GOPATH\bin in module mode.
  gopkgs
  guru
  gorename
  gotests
  gomodifytags
  impl
  fillstruct
  goplay
  godoctor
  dlv
  gocode-gomod
  goreturns

Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs (D:\Software\Go\GOPATH\bin\gopkgs.exe) SUCCEEDED
Installing golang.org/x/tools/cmd/guru (D:\Software\Go\GOPATH\bin\guru.exe) SUCCEEDED
Installing golang.org/x/tools/cmd/gorename (D:\Software\Go\GOPATH\bin\gorename.exe) SUCCEEDED
Installing github.com/cweill/gotests/... (D:\Software\Go\GOPATH\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags (D:\Software\Go\GOPATH\bin\gomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl (D:\Software\Go\GOPATH\bin\impl.exe) SUCCEEDED
Installing github.com/davidrjenni/reftools/cmd/fillstruct (D:\Software\Go\GOPATH\bin\fillstruct.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay (D:\Software\Go\GOPATH\bin\goplay.exe) SUCCEEDED
Installing github.com/godoctor/godoctor (D:\Software\Go\GOPATH\bin\godoctor.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv (D:\Software\Go\GOPATH\bin\dlv.exe) SUCCEEDED
Installing github.com/stamblerre/gocode (D:\Software\Go\GOPATH\bin\gocode-gomod.exe) SUCCEEDED
Installing github.com/sqs/goreturns (D:\Software\Go\GOPATH\bin\goreturns.exe) SUCCEEDED