Go doc: Difference between revisions

From NovaOrdis Knowledge Base
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. <...")
 
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=<port>
go doc --http=":8080"
</syntaxhighlight>
</syntaxhighlight>



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"

Deplete: doc