Installation of Go and Goland
Article Directory
GO official website address: https://golang.google.cn/
Go Chinese website address: https://studygolang.com/dl
The directory obtained after the installation is complete
Environment variable configuration:
1. New variable
变量名:GOROOT
变量值:Go的安装目录路径
2. Add the variable value in the path: the bin file of the go file
Test for successful installation
1. Goland official website
Official website download address: https://www.jetbrains.com/go/download/#section=windows
Install directly after downloading
2. Open Goland and enter the activation code
If you need to Sinicize Goland, you can download a Chinese language pack plug-in
GOROOT and GOPATH
-
GOROOT is the installation path and GOPATH is the workspace
-
There are generally three files in the GOPATH file: bin, src, pkg
-
src: store source code
-
bin: store the generated binary files
-
pkg: store the generated intermediate cache files
-
In the new project of GoLand, the file will be automatically created in the src directory of $GOPATH
About modifying the GOPATH directory
After installation, the GOPATH directory defaults to the go folder in the D drive user directory. For example, my default path: D:\Code\GO_Code\awesomeProject
Modification method:
- win+r cmd
- Run the command: setx GOPATH directory
Re-open cmd and enter the go env command to find the GOPATH directory and successfully modify
the GoLand .go file to run