目录

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

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!
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄