Install the Go environment on Windows

Download the one-click installation package for Windows from the Go official website.

Then double-click to open the file, just keep clicking Next.

Note That the installation is performed on drive C by default. You are advised not to change the Settings because environment variables are automatically set. If the installation is performed on another drive, you may need to manually change the values of all environment variables.

2. View environment variables

Open the control panel and click on user accounts:

Click on user account again:

Click on the left to change my environment variable:

Find that the GOPATH environment variable already exists:

Test whether the Go environment is installed successfully

Create a new hello_world.go file.

Enter the following code:

// hello_world.go
package main

func main(a) {
	println("Hello"."world")}Copy the code

Then open PowerShell, go to the file path, and type:

go run hello_world.go
Copy the code

Hello world:

Install GoLand

GoLand or VS Code are two ides that are recommended online. Select Install Goland here. Download it from the official website and keep clicking Next.

64-bit launcher, Add Launchers dir to the PATH, and. Go are selected. Create desktop shortcuts 64 bits, update the PATH environment variable, and associate.go files.

I didn’t choose to install any other plug-ins here.

Then open the previous hello_world.go file, run it, and print the result successfully.

Five, the reference

Install Go on Windows

Win10 environment variable how to set? 3 Ways to Create environment variables in Windows 10

What ides does Golang have? – Poloxue’s answer – Zhihu