mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +08:00
@@ -10,7 +10,7 @@
|
||||
- `go doc package/subpackage` 获取子包的文档注释,例如:`go doc container/list`。
|
||||
- `go doc package function` 获取某个函数在某个包中的文档注释,例如:`go doc fmt Printf` 会显示有关 `fmt.Printf()` 的使用说明。
|
||||
|
||||
这个工具只能获取在 Go 安装目录下 `.../go/src` 中的注释内容。此外,它还可以作为一个本地文档浏览 web 服务器。在命令行输入 `godoc -http=:6060`,然后使用浏览器打开 [http://localhost:6060](http://localhost:6060) 后,你就可以看到本地文档浏览服务器提供的页面。
|
||||
这个工具只能获取在 Go 安装目录下 `../go/src` 中的注释内容。此外,它还可以作为一个本地文档浏览 web 服务器。在命令行输入 `godoc -http=:6060`,然后使用浏览器打开 [http://localhost:6060](http://localhost:6060) 后,你就可以看到本地文档浏览服务器提供的页面。
|
||||
|
||||
`godoc` 也可以用于生成非标准库的 Go 源码文件的文档注释(第 9.6 章)。
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
|
||||
- [目录](directory.md)
|
||||
- 上一节:[格式化代码](03.5.md)
|
||||
- 下一节:[其它工具](03.7.md)
|
||||
- 下一节:[其它工具](03.7.md)
|
||||
|
Reference in New Issue
Block a user