安装GO开发环境
[[email protected] ~]# yum install golang
GO的Hello world
[[email protected] ~]# cat hello.go package main import ( "fmt" ) func main() { fmt.Println("Hello world") } [[email protected] ~]#
直接运行
[[email protected] ~]# go run hello.go Hello world [[email protected] ~]#
编译成机器码,并运行
[[email protected] ~]# go build hello.go [[email protected] ~]# ./hello Hello world [[email protected] ~]#
时间: 2024-12-23 08:06:57