tldr/pages/common/godoc.md

25 lines
499 B
Markdown
Raw Normal View History

2018-07-12 08:17:25 +01:00
# godoc
> View documentation for go packages.
> More information: <https://godoc.org/>.
2018-07-12 08:17:25 +01:00
- Display help for a specific package:
2018-07-12 08:17:25 +01:00
`godoc {{fmt}}`
- Display help for the function "Printf" of "fmt" package:
`godoc {{fmt}} {{Printf}}`
- Serve documentation as a web server on port 6060:
2018-07-12 08:17:25 +01:00
`godoc -http=:{{6060}}`
- Create an index file:
`godoc -write_index -index_files={{path/to/file}}`
- Use the given index file to search the docs:
`godoc -http=:{{6060}} -index -index_files={{path/to/file}}`