2020-05-08 20:40:35 +08:00
|
|
|
# go doc
|
|
|
|
|
2020-05-15 00:01:50 +08:00
|
|
|
> Show documentation for a package or symbol.
|
2020-05-11 12:02:04 +08:00
|
|
|
> More information: <https://golang.org/cmd/go/#hdr-Show_documentation_for_package_or_symbol>.
|
2020-05-08 20:40:35 +08:00
|
|
|
|
2020-05-15 00:01:50 +08:00
|
|
|
- Show documentation for the current package:
|
2020-05-08 20:40:35 +08:00
|
|
|
|
2020-05-11 12:02:04 +08:00
|
|
|
`go doc`
|
2020-05-08 20:40:35 +08:00
|
|
|
|
2020-05-11 12:02:04 +08:00
|
|
|
- Show package documentation and exported symbols:
|
2020-05-08 20:40:35 +08:00
|
|
|
|
2020-05-11 12:02:04 +08:00
|
|
|
`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}}`
|