Home > Article > Backend Development > Teach you step by step how to configure Golang environment
# 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 highest default version, the Go code is backward compatible, Differences between versions don't matter
1. Find the downloaded installation file.
2. Double-click to install
3. Select Agree
##4.Customize Install location.
##5. Click install to install.
6. 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 , enter the go version
command, as shown
Note:Since it is already version 1.11, we will use go mod
to manage dependencies in the future, no configuration is requiredGOPATH and other weird stuff.
Maybe we need Use Go to download some packages or something.
But the default official website source, GOPROXY=https://proxy.golang.org,direct
, is in Unable to access in China
输入go env
查看Go配置
需要修改成国内镜像站点,这里推荐:
https://goproxy.io
执行以下命令,进行修改
go env -w GOPROXY=https://goproxy.cn,direct
重新打开CMD
,执行go env
查看Go配置
Go’s current development editors mainly include VSCode
, Goland
Two kinds. The recommended ones for this tutorial are Goland
, and Pycharm
Belong to the same company. The installation and cracking of Goland
will not be described here.
When I first started writing Go, I actually used VSCode
, but I found when using it, VSCode
always does not prompt automatically, and the automatic save setting often fails automatically. I have experienced this several times. After much trouble, I finally embraced the IDE developed specifically for Go, Goland
!!!, it’s so delicious.
The above is the detailed content of Teach you step by step how to configure Golang environment. For more information, please follow other related articles on the PHP Chinese website!