Go Concepts - Documentation: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 33: Line 33:
go doc fmt Println
go doc fmt Println
</pre>
</pre>
=Package=
<pre>
go doc <package>
</pre>
=Function=
<pre>
go doc <package> <function-name>
</pre>
Example:
<pre>
go doc fmt Println
</pre>


=Writing Documentation=
=Writing Documentation=

Revision as of 00:52, 2 April 2016

Internal

Overview

Go generates in-line documentation for symbols in packages, via the go doc command.

Reading Documentation

To read the package summary:

go doc <package-name>

Example:

go doc fmt

To get the documentation for a package identifier (function name, type, etc):

go doc <package-name> <identifier>

Example:

go doc fmt Println

Writing Documentation