笔者在学习go语言的时候发现了一个很不错的网站Go by Example: Hello World,借此翻译成中文教程供大家参考学习。
go run xx.go//编译运行go文件
go build xx.go//将go文件打包成二进制可执行文件
./hello_world//直接执行打印helloworld
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
笔者在学习go语言的时候发现了一个很不错的网站Go by Example: Hello World,借此翻译成中文教程供大家参考学习。
go run xx.go//编译运行go文件
go build xx.go//将go文件打包成二进制可执行文件
./hello_world//直接执行打印helloworld
package main
import "fmt"
func main() {
fmt.Println("hello world")
}