目錄
- Golang | 基礎 - 1. 第一個Go程式
- 1. 撰寫第一個go程式
- 2. 運行
- 3. 編譯,還以使用go build命令來生成一個二進制檔案:
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.uj5u.com/houduan/6571.html
標籤:Go
