Skip to main content
我决定学习 GoLang.

GoLang

GoLang is developed by Google.For more information,please visit https://golang.google.cn.
Download: https://golang.google.cn/dl/
  • 添加环境变量

提示

本文档不建议没有任何经验关于 Programming 的人学习(尽管我猜你们也不在这里学习 Go)。Linserin 有 C++ 的编写经历(NOI),本文档会不由自主地带上一些 C++ 思维。

Hello World!

go mod init example/hello

go.mod

此时在工作目录下方应该会存在一个 go.mod 文件,此文件为 Go 项目的标志,随后 go mod idy 会用到。
粘贴代码:
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}
运行:
>go run .
Hello, World!
构建输出:
>go build -o [可执行文件]
至此,Hello World 完成。 参考:Go 官方教程
Last modified on June 24, 2026