LinuxCommandLibrary

godoc

Go documentation server and viewer

TLDR

Start documentation server

$ godoc -http=:6060
copy
Show package docs
$ godoc [fmt]
copy
Show specific function
$ godoc [fmt Println]
copy
Output HTML
$ godoc -html [package]
copy

SYNOPSIS

godoc [options] [package] [symbol]

DESCRIPTION

godoc extracts and generates documentation for Go packages. It can serve documentation as a web server or print to the console, providing browsable, searchable documentation.
The HTTP server mode indexes all packages in GOPATH/GOROOT for comprehensive browsing with source code links. For quick command-line lookups, the `go doc` subcommand is preferred.

PARAMETERS

PACKAGE

Package to document.
SYMBOL
Symbol to look up.
-http ADDR
Start HTTP server.
-html
Output HTML format.
-src
Show source code.
--help
Display help information.

CAVEATS

Separate install since Go 1.12. Use go doc for quick lookups. Server mode for browsing.

HISTORY

godoc was the original Go documentation tool, now available separately from golang.org/x/tools/cmd/godoc.

SEE ALSO

go-doc(1), go(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community