1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-10-30 04:17:58 +01:00
tldr/pages/common/godoc.md
2018-08-20 17:31:17 +01:00

454 B

godoc

Show documentation for go packages.

  • Display help for package "fmt":

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}}