2018-07-12 00:17:25 -07:00
|
|
|
# godoc
|
|
|
|
|
2024-01-31 00:55:19 -03:00
|
|
|
> View documentation for go packages.
|
2019-06-03 02:06:36 +02:00
|
|
|
> More information: <https://godoc.org/>.
|
2018-07-12 00:17:25 -07:00
|
|
|
|
2024-01-30 01:55:24 -03:00
|
|
|
- Display help for a specific package:
|
2018-07-12 00:17:25 -07:00
|
|
|
|
|
|
|
`godoc {{fmt}}`
|
|
|
|
|
|
|
|
- Display help for the function "Printf" of "fmt" package:
|
|
|
|
|
|
|
|
`godoc {{fmt}} {{Printf}}`
|
|
|
|
|
2021-01-31 14:05:18 -03:00
|
|
|
- Serve documentation as a web server on port 6060:
|
2018-07-12 00:17:25 -07:00
|
|
|
|
|
|
|
`godoc -http=:{{6060}}`
|
2018-08-20 22:01:17 +05:30
|
|
|
|
|
|
|
- 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}}`
|