Go doc: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=External= =Internal= * Go Tool =Overview= The <code>doc</code> command prints documentation for a package or a package member: <syntaxhighlight lang='go'> go doc time </syntaxhighlight> <syntaxhighlight lang='go'> go doc time.Since </syntaxhighlight> It is a great exercise to use <code>go doc</code> in the early phase of a package's API design to see how the concepts will be rendered in documentation. Sometimes, the visualization has impact on design. <...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 15: | Line 15: | ||
Use this to start a <tt>godoc</tt> server locally: | Use this to start a <tt>godoc</tt> server locally: | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
go doc --http= | go doc --http=":8080" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=TODO= | |||
<font color=darkkhaki> | <font color=darkkhaki> | ||
Deplete: [[Go Concepts - Documentation#Reading_Documentation|doc]] | Deplete: [[Go Concepts - Documentation#Reading_Documentation|doc]] | ||
</font> | </font> |
Latest revision as of 23:40, 5 July 2024
External
Internal
Overview
The doc
command prints documentation for a package or a package member:
go doc time
go doc time.Since
It is a great exercise to use go doc
in the early phase of a package's API design to see how the concepts will be rendered in documentation. Sometimes, the visualization has impact on design. go doc
is the way the users will consume the package.
Use this to start a godoc server locally:
go doc --http=":8080"
TODO
Deplete: doc