# 24 包

Go语言中的一个包(package)表示相关联的代码组成的一个单元，其他语言通常称它们为库(libraries)。

一个包由单个目录中的多个文件组成，目录和包之间是一对一映射关系。

在单个代码库中，可以有多个包。

Go语言的标准库通常就是由一组包提供的。

一个包是通过它的导入路径标识的，例如`github.com/gomarkdown/markdown`就是解析markdown格式的包的导入路径。


---

# 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/24-packages.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.
