安装GO开发环境
[root@localhost ~]# yum install golang
GO的Hello world
[root@localhost ~]# cat hello.go 
package main
import (
    "fmt"
)
func main() {
    fmt.Println("Hello world")
}
[root@localhost ~]#直接运行
[root@localhost ~]# go run hello.go Hello world [root@localhost ~]#
编译成机器码,并运行
[root@localhost ~]# go build hello.go [root@localhost ~]# ./hello Hello world [root@localhost ~]#
本文出自 “李春利” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1966989
原文:http://990487026.blog.51cto.com/10133282/1966989