本人选择安装的是golang版本如下:
C:\WINDOWS\system32>go version
go version go1.15.3 windows/amd64
在配置完vs的基本设置后,使用自带地址安装golang插件安装失败。因为国内网络原因,如果电脑已经“科学上网”的同学,可以不用看了。
下面进行解决:
1、打开windows的powershell,输入以下代码:
PS C:\Users\wutongyu> $env:GO111MODULE="ON"
PS C:\Users\wutongyu> $env:GOPROXY="https://goproxy.io"
2、可以在vscode中安装了
Tools environment: GOPATH=/Users/honglei/dev/go
Installing 17 tools at /Users/honglei/dev/go/bin in module mode.
gocode
gopkgs
go-outline
go-symbols
guru
gorename
gotests
gomodifytags
impl
fillstruct
goplay
godoctor
dlv
gocode-gomod
godef
goreturns
golint
Installing github.com/mdempsky/gocode (/Users/honglei/dev/go/bin/gocode) SUCCEEDED
Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs (/Users/honglei/dev/go/bin/gopkgs) SUCCEEDED
Installing github.com/ramya-rao-a/go-outline (/Users/honglei/dev/go/bin/go-outline) SUCCEEDED
Installing github.com/acroca/go-symbols (/Users/honglei/dev/go/bin/go-symbols) SUCCEEDED
Installing golang.org/x/tools/cmd/guru (/Users/honglei/dev/go/bin/guru) SUCCEEDED
Installing golang.org/x/tools/cmd/gorename (/Users/honglei/dev/go/bin/gorename) SUCCEEDED
Installing github.com/cweill/gotests/... (/Users/honglei/dev/go/bin/gotests) SUCCEEDED
Installing github.com/fatih/gomodifytags (/Users/honglei/dev/go/bin/gomodifytags) SUCCEEDED
Installing github.com/josharian/impl (/Users/honglei/dev/go/bin/impl) SUCCEEDED
Installing github.com/davidrjenni/reftools/cmd/fillstruct (/Users/honglei/dev/go/bin/fillstruct) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay (/Users/honglei/dev/go/bin/goplay) SUCCEEDED
Installing github.com/godoctor/godoctor (/Users/honglei/dev/go/bin/godoctor) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv (/Users/honglei/dev/go/bin/dlv) SUCCEEDED
Installing github.com/stamblerre/gocode (/Users/honglei/dev/go/bin/gocode-gomod) SUCCEEDED
Installing github.com/rogpeppe/godef (/Users/honglei/dev/go/bin/godef) SUCCEEDED
Installing github.com/sqs/goreturns (/Users/honglei/dev/go/bin/goreturns) SUCCEEDED
Installing golang.org/x/lint/golint (/Users/honglei/dev/go/bin/golint) SUCCEEDED
All tools successfully installed. You are ready to Go :).
好了,可以愉快的写代码了!