Home >Backend Development >Python Tutorial >Take you step by step to configure the Golang environment
Hello everyone, I am Zhou Ba, a three-year coder who has to comb his only three hairs in front of the mirror every day
Let’s arrange it this time How to configure the Go language development environment on the win platform.
Overall, Go configuration environment is quite easy, similar to Python, and environment variables will be added automatically.
Go official mirror site:
https://golang.google.cn/dl/
Just choose the default highest version, the Go code is downward compatible, and the difference between versions The difference doesn’t matter
1. Find the downloaded installation file.
2. Double-click to install
3. Select Agree
4. Customize the installation location.
5. Click install to install.
#6. The installation is in progress, wait until the installation is completed.
7. Click finish to complete the installation.
Check whether the installation is successful
After the above installation process is OK, open the CMD window and enter go version command, as shown in the figure
Note: Since it is already version 1.11, we will use go mod to manage dependencies in the future, and there is no need to configure GOPATH Waiting for weird stuff.
Maybe we need to borrow Go to download some packages or something.
But the default official website source, GOPROXY=https://proxy.golang.org,direct, cannot be accessed in China
Enter go env to view the Go configuration
Needs to be modified to a domestic mirror site, here is the recommendation:
https://goproxy.io
Execute the following command to make modifications
go env -w GOPROXY=https://goproxy.cn,direct
Reopen CMD, Execute go env to view the Go configuration
The above is the detailed content of Take you step by step to configure the Golang environment. For more information, please follow other related articles on the PHP Chinese website!