Home > Article > Backend Development > 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
##Go development editorGo current development editor There are two main types of servers: VSCode and Goland. The recommendation for this tutorial is Goland, which belongs to the same company as Pycharm. The installation and cracking of Goland will not be described here. Why didn’t I choose VSCodeWhen I first started writing Go, I actually used VSCode, but when I used it, I found that VSCode always did not automatically prompt, and the automatic save setting often fails automatically. After several twists and turns, I still embraced the IDE specially developed for Go, Goland!!!, it’s really delicious.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!