command module
v0.0.0-...-23daad8 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2015 License: BSD-3-Clause Imports: 16 Imported by: 0



Doc is an old program that was used to design a nice command-level API for presenting Go documentation. It is deprecated; use the new go doc in 1.5 instead.

Doc is a simple document printer that produces the doc comments for its argument symbols, plus a link to the full documentation and a pointer to the source. It has a more Go-like UI than godoc. It can also search for symbols by looking in all packages, and case is ignored. For instance:

doc isupper

will find unicode.IsUpper.

The -pkg flag retrieves package-level doc comments only.


doc   # "doc io.Writer"
doc pkg name   # "doc fmt Printf"
doc name       # "doc isupper" (finds unicode.IsUpper)
doc -pkg pkg   # "doc fmt"

The pkg is the last element of the package path; no slashes (ast.Node not go/ast.Node).

The name may also be a regular expression to select which names to match. In regular expression searches, case is ignored and the pattern must match the entire name, so ".?print" will match Print, Fprint and Sprint but not Fprintf.


-c(onst) -f(unc) -i(nterface) -m(ethod) -s(truct) -t(ype) -v(ar)

restrict hits to declarations of the corresponding kind. Flags

-doc -src -url

restrict printing to the documentation, source path, or godoc URL. Flags

-doc -src -url

restrict printing to the documentation, source path, or godoc URL. Flag


takes a single argument (no package), a name or regular expression to search for in all packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL