Golang first go program

Time:2021-11-30

In this section, let’s learn to write the simplest Go program: print Hello go

The first go program, just follow it and leave an impression

useGolandCreate ahello_go.goFile (suffix:.go)2. The content of the document is

package main

import "fmt"

func main() {
	fmt.Println("Hello Go")
}

stayGolandUsing shortcut keys inCtrl + Shift + F10Run the program and the results are as follows:

image

Perfect! Now you have learned how to run a go program

Li peiguan blog

lpgit.com