Golang环境配置以及Vscode依赖安装
仅针对Windows的个人笔记
下载
- 从官网下载msi安装
- 另新建工作目录gowork,在gowork下新建pkg,bin,src
- 个人代码放在src\github.com\xxx下
基础环境变量配置
-
GOPATH:gowork路径
-
GOROOT:安装目录路径
-
用户环境变量Path:gowork\bin
-
系统环境变量Path:安装目录路径\bin
为安装Vscode依赖的环境变量
- GO111MODULE:on
- GOPROXY:
– 阿里云-https://mirrors.aliyun.com/goproxy/
– 七牛云-https://goproxy.cn/
Vscode安装依赖项
- Ctrl+Shift+P → Go: Install/Update Tools
proto生成工具安装
- go install github.com/golang/protobuf/protoc-gen-go@latest // go 1.16+