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