[Go programming language] Installation of Go and Goland

Installation of Go and Goland




GO official website address: https://golang.google.cn/
insert image description here

Go Chinese website address: https://studygolang.com/dl

insert image description here
insert image description here

insert image description here

insert image description here
insert image description here
insert image description here

insert image description here
insert image description here
The directory obtained after the installation is complete
insert image description here

Environment variable configuration:

insert image description here
insert image description here
insert image description here

1. New variable

变量名:GOROOT
变量值:Go的安装目录路径

insert image description here
2. Add the variable value in the path: the bin file of the go file
insert image description here

insert image description here

Test for successful installation
insert image description here
insert image description here

1. Goland official website

Official website download address: https://www.jetbrains.com/go/download/#section=windows
insert image description here
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
insert image description here

insert image description here

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
insert image description here
insert image description here

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

insert image description here
Re-open cmd and enter the go env command to find the GOPATH directory and successfully modify
insert image description here
the GoLand .go file to run

insert image description here


Guess you like

Origin blog.csdn.net/guanguan12319/article/details/130534674