> For the complete documentation index, see [llms.txt](https://denglj.gitbook.io/essential-go/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://denglj.gitbook.io/essential-go/01-getting-started/hello-world.md).

# Hello, World!

创建一个名为`helloworld.go`的文件：

```go
package main

import "fmt"

func main() {
	fmt.Println("Hello, 世界!")
}
```

{% hint style="info" %}
您可以 :point\_right: [点击此处](https://play.golang.org/p/aeKHsDfXOv5) :point\_left: 到Golang在线编程操场运行上述代码。
{% endhint %}

您也可以在本地系统通过命令行执行`go run helloworld.go`运行它。

`go run`命令对临时执行单文件的程序很有用。

如果您想生成可执行文件，请使用`go build helloworld.go`。

在Windows系统上将会生成`.\helloworld.exe`可执行文件。

在其他操作系统上则会生成`./helloworld`可执行文件。
