vscode配置golang开发环境
第一种方式
安装Vscode 和 Golang
略
在go module 模式下加载工具包
```
mkdit test
cd test
go mod init test
```
配置代理
```
// set GOPROXY=https://proxy.golang.org
set GOPROXY=https://mirrors.aliyun.com/goproxy/
// GO 1.13+
go env -w GOPROXY=https://mirrors.aliyun.com/goproxy,direct
go env -w GOSUMDB=sum.golang.google.cn
```
下载依赖包
go get github.com/stamblerre/gocode
下载 gin
go get -u github.com/gin-gonic/gin
第二种方式
设置代理
$env:GOPROXY = "https://goproxy.io"
下载依赖包 和 gin
PS F:\workspace\go\src\gin-study> go get github.com/stamblerre/gocode
go: downloading github.com/stamblerre/gocode v1.0.0
go: github.com/stamblerre/gocode upgrade => v1.0.0
go: downloading github.com/keegancsmith/rpc v1.1.0
go: downloading golang.org/x/tools v0.0.0-20191030062658-86caa796c7ab
PS F:\workspace\go\src\gin-study> go get -u github.com/gin-gonic/gin
go: github.com/gin-gonic/gin upgrade => v1.6.3
go: github.com/golang/protobuf upgrade => v1.4.2
go: github.com/ugorji/go/codec upgrade => v1.1.8
go: github.com/json-iterator/go upgrade => v1.1.10
go: github.com/go-playground/validator/v10 upgrade => v10.3.0
go: golang.org/x/sys upgrade => v0.0.0-20200918174421-af09f7315aff
go: github.com/modern-go/reflect2 upgrade => v1.0.1
go: gopkg.in/yaml.v2 upgrade => v2.3.0
go: github.com/modern-go/concurrent upgrade => v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: google.golang.org/protobuf upgrade => v1.25.0
go: downloading google.golang.org/protobuf v1.25.0
PS F:\workspace\go\src\gin-study>