go-doc

display Go package and symbol documentation

TLDR

Show package documentation
$ go doc [fmt]
Show function documentation
$ go doc [fmt.Println]
Show all documentation
$ go doc -all [package]
Show unexported symbols
$ go doc -u [package]
Show source code
$ go doc -src [fmt.Println]

SYNOPSIS

go doc [options] [package] [symbol]

DESCRIPTION

go doc shows documentation for Go packages and symbols. It extracts documentation from source code comments following Go documentation conventions.The command displays documentation for packages, types, functions, and methods. It can show source code and unexported symbols for development reference.

PARAMETERS

PACKAGE

Package to document.
SYMBOL
Symbol to look up.
-all
Show all documentation.
-u
Include unexported.
-src
Show source code.
-c
Case-sensitive matching.
-cmd
Treat a command (package main) like a regular package, showing its exported symbols.
-short
Print a one-line representation for each symbol.
-http
Serve HTML documentation over HTTP instead of printing to stdout.
--help
Display help information.

INSTALL

sudo zypper install go-doc

CAVEATS

Reads from source, not installed docs. Standard library always available. Custom packages need source.

HISTORY

go doc is part of the Go toolchain, providing documentation access following Go's convention of documentation in source code.

SEE ALSO

go(1), godoc(1)

RESOURCES

Documentation · Source code