Install go locale
Installation method (if not, follow the steps of the rookie tutorial to install):
yum search go
yum install ***
Novice tutorial installation method:
go environment installation
hello world
package main
import "fmt"
// 1. func 关键字
// 2. return_value 函数返回值,无返回值则省略
// 3. func_name 函数名以及参数
func main(){
fmt.Println("hello!")
}
- Introduction of formatted output
import "fmt"
- Define the syntax format of the function