我们来编写第一个 Go 程序 hello.go(Go语言源文件的扩展是 .go),代码如下:

package main

import "fmt"

func main() {
   fmt.Println("Hello, World!")
}

执行以上代码输出

$ go run hello.go 
Hello, World!
本文来自木庄网络博客> 第一个 Go 程序

木庄
18 声望2 粉丝

« 上一篇
Go语言简介