1:安装go之后。可以执行 go version
2: 国内需要更换源。
go env -w GOPROXY=https://goproxy.cn,direct
3:VS执行:go:install/update tools .安装这个就可以自动导入包了
Installing 9 tools at d:\goapp\bin in module mode.
gopkgs
go-outline
gotests
gomodifytags
impl
goplay
dlv
golint
gopls
Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs (d:\goapp\bin\gopkgs.exe) SUCCEEDED
Installing github.com/ramya-rao-a/go-outline (d:\goapp\bin\go-outline.exe) SUCCEEDED
Installing github.com/cweill/gotests/... (d:\goapp\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags (d:\goapp\bin\gomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl (d:\goapp\bin\impl.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay (d:\goapp\bin\goplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv (d:\goapp\bin\dlv.exe) SUCCEEDED
Installing golang.org/x/lint/golint (d:\goapp\bin\golint.exe) SUCCEEDED
Installing golang.org/x/tools/gopls (d:\goapp\bin\gopls.exe) SUCCEEDED