Download the installation package
Preparation#
Download the compiler
Compiler download:
https://www.jetbrains.com.cn/go
Paid
vscode, vim
Free
1. Go Installation#
I will directly download the Go language installation package here,
Unzip to D:\software\go directory:
2. Environment Configuration#
The approximate location for configuring Windows system environment variables: Advanced system settings > Environment Variables > System Variables
Variable name: GO_HOME1231
Click Path:
Add
Create Go third-party packages:
The meanings of the three directories under GOPATH are as follows:
The src directory mainly stores Go source files
The pkg directory stores compiled library files, mainly *.a files;
The bin directory mainly stores executable files
Click Path:
Add
GOPATH is the path for storing Go tool dependencies, you can set it yourself; I placed it in a directory created by GoWorks, which needs to include src, pkg, and bin three directories. Set to
Check if the installation was successful#
Check the version:
Check the environment variables:
Configure Go Proxy#
Add proxy in environment variables
GOPROXY
Purpose: Downloading foreign packages is relatively slow, using domestic proxies is faster
Common Go Proxies#
- goproxy https://goproxy.io/zh/
- Aliyun https://mirrors.aliyun.com/goproxy/
- Qiniu Cloud https://goproxy.cn
Other Operating Systems#
Configure Go proxy under mac/linux
Reference: https://goproxy.io/zh/