1. 打印 hello world
// file_name: hello_world.gopackage mainimport "fmt"func main() {fmt.Println("Hello, world")}
2. 编译
以脚本运行
[root@VM-8-5-centos syntax]# go run hello-word.goHello, world
生成二进制文件
[root@VM-8-5-centos syntax]# go build hello-word.go[root@VM-8-5-centos syntax]# lshello-word hello-word.go[root@VM-8-5-centos syntax]# ./hello-wordHello, world
