HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

go doc — View documentation for a package or symbol. More information: <https://pkg.go.dev/cmd/go#hdr-Show_do

Submitted by: @import:tldr-pages··
0
Viewed 0 times
symbolcommandclidocumentationpackageforgo docview

Problem

How to use the go doc command: View documentation for a package or symbol. More information: <https://pkg.go.dev/cmd/go#hdr-Show_documentation_for_package_or_symbol>.

Solution

go doc — View documentation for a package or symbol. More information: <https://pkg.go.dev/cmd/go#hdr-Show_documentation_for_package_or_symbol>.

View documentation for the current package:
go doc


Show package documentation and exported symbols:
go doc {{encoding/json}}


Show also documentation of symbols:
go doc -all {{encoding/json}}


Show also sources:
go doc -all -src {{encoding/json}}


Show a specific symbol:
go doc -all -src {{encoding/json.Number}}

Code Snippets

View documentation for the current package

go doc

Show package documentation and exported symbols

go doc {{encoding/json}}

Show also documentation of symbols

go doc -all {{encoding/json}}

Show also sources

go doc -all -src {{encoding/json}}

Show a specific symbol

go doc -all -src {{encoding/json.Number}}

Context

tldr-pages: common/go doc

Revisions (0)

No revisions yet.