编写hello.go如下
1 package main
2
3 import "fmt"
4
5 func main(){
6 fmt.Println("hello world")
7
8 }
运行hello.go
go run hello.go
本文介绍了一个简单的Go语言程序——HelloWorld。通过这段代码,读者可以了解到如何使用Go语言的基本语法来实现一个简单的控制台输出。
1 package main
2
3 import "fmt"
4
5 func main(){
6 fmt.Println("hello world")
7
8 }
go run hello.go
1216

被折叠的 条评论
为什么被折叠?