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