# 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`可执行文件。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://denglj.gitbook.io/essential-go/01-getting-started/hello-world.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
