1. Download address
Go to studygolang.com/dl
The official downloadgolang.google.cn/
2. Install
After the download is complete, double-click the downloaded MSI file
Pretty much all the way to NEXT
Check the check box when “I accept the terms in the License Agreeement” is displayed
When you go to the following interface, you can change it to the directory you want to install
If the installation is successful, wait until the following interface is displayed
3. Installation directory description
API – Store all apis for Idea use
Bin – Stores compiled executable files
Doc – To store related help documents
Lib — Common library
Misc – A plug-in that houses various editors
PKG – After go Instal is complete, store all archive files of the Go language standard library
SRC — Contains all the standard libraries of the GO language, including C implementation code. Learn about the GO language here
Test — Stores the test code file
4. Set environment variables
Environment variables have been automatically set during installation
GOROOT: Go Root directory after installation (for example, D:\Go). It is automatically written to system environment variables by the installation program during installation. GOPATH: project directory (for example: D:\go_work) PATH: Add %GOROOT%\bin, %GOPATH%\ PKG, %GOPATH%\bin to the end of the PATH variable for easy running on the command line. When the environment variables are configured, Go is installed. Open the command line and run the go command to see the following promptCopy the code
After the configuration is complete, run the go env command to check whether the configuration data can be viewed. If the following figure is displayed, the configuration is successful
Create three folders under the project directory (GOPATH configured directory)
5. Configure the MOD mode
Not required for version 1.10.0 or earlier, run in CMD
Env -w GOBIN=D: env With the environment variable [% GOPATH % \ bin] to maintain consistent) go env - w GO111MODULE = on the go env - w GOPROXY = https://goproxy.cn, directCopy the code