LinuxCommandLibrary

go-doc

display Go package and symbol documentation

TLDR

Show package documentation

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

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.
--help
Display help information.

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community