Go: cmd/doc Files

Command doc

Doc (usually run as go doc) accepts zero, one or two arguments.

Zero arguments:

go doc

Show the documentation for the package in the current directory.

One argument:

go doc <pkg>
go doc <sym>[.<methodOrField>]
go doc [<pkg>.]<sym>[.<methodOrField>]
go doc [<pkg>.][<sym>.]<methodOrField>

The first item in this list that succeeds is the one whose documentation is printed. If there is a symbol but no package, the package in the current directory is chosen. However, if the argument begins with a capital letter it is always assumed to be a symbol in the current directory.

Two arguments:

go doc <pkg> <sym>[.<methodOrField>]

Show the documentation for the package, symbol, and method or field. The first argument must be a full package path. This is similar to the command-line usage for the godoc command.

For commands, unless the -cmd flag is present "go doc command" shows only the package-level docs for the package.

For complete documentation, run "go help doc".

Package Files

dirs.go main.go pkg.go

Package main imports 17 packages (graph). Updated 2017-08-29. Refresh now. Tools for package owners.