The first step
Download the Go installation package at Go Language Chinese website. The installation directory is as follows:
View the current version using the command line:
The second step
To configure environment variables, create two environment variables as follows:
For details about how to configure other platforms, see goProxy’s official website.
The third step
Open vscode and install a Go plugin as follows:
Then open an existing folder and create a hello.go file. At this point, you will be prompted to Install the corresponding application in the lower right corner.
At this point the environment is set up
The fourth step
Write the go program in the Hello. go file
package main
import "fmt"
func main() {
fmt.Println("hello World")
}
Copy the code
Execute the following command on the terminal to generate the go.mod file
go mod init gitee.com/mall_lucy/my_go_studycode
Copy the code
Then run Hello. go from the terminal as follows: