Golang | 基础 - 1. 第一个Go程序

1. 编写第一个go程序

package main

import "fmt"

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

2. 运行

[root@jeremy golang]# go run hello.go
Hello World!

3. 编译,还以使用go build命令来生成一个二进制文件:

[root@jeremy golang]# go build hello.go
[root@jeremy golang]# ls
hello  hello.go
[root@jeremy golang]# ./hello
Hello World!
内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/jeremy-zhang/p/13065246.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!