1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-30 17:13:55 +02:00
tldr/pages/common/godoc.md
Managor 99c7af4917
*: use a more specific more info link, org domain (#17699)
Mass update for more specific "more info" links
2025-08-16 11:12:49 -07:00

24 lines
528 B
Markdown

# godoc
> View documentation for go packages.
> More information: <https://pkg.go.dev/golang.org/x/tools/cmd/godoc>.
- Display help for a specific package:
`godoc {{fmt}}`
- Display help for the function "Printf" of "fmt" package:
`godoc {{fmt}} {{Printf}}`
- Serve documentation as a web server on port 6060:
`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}}`