Golang documentation: Difference between revisions

From wikinotes
(Created page with "= Documentation = <blockquote> {| class="wikitable" |- | standard library || https://pkg.go.dev/std |- |} </blockquote><!-- Documentation --> = go doc = <blockquote> <syntaxhighlight lang="bash"> # list module docs/sigs (stdlib, internal) go doc internal/logger go doc io | bat -l go # nicely syntax highlighted </syntaxhighlight> </blockquote><!-- -->")
 
No edit summary
 
Line 10: Line 10:
= go doc =
= go doc =
<blockquote>
<blockquote>
Quickly refer to api docs on CLI
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# list module docs/sigs (stdlib, internal)
# list module docs/sigs (stdlib, internal)
Line 16: Line 17:
</syntaxhighlight>
</syntaxhighlight>
</blockquote><!--  -->
</blockquote><!--  -->
= godoc =
<blockquote>
Show website with apidocs -- standard library, used go modules, and your own package.
<syntaxhighlight lang="bash">
go install golang.org/x/tools/cmd/godoc@latest
</syntaxhighlight>
<syntaxhighlight lang="bash">
godoc
open 'http://localhost:6060'
</syntaxhighlight>
</blockquote><!-- godoc -->

Latest revision as of 19:05, 23 July 2022

Documentation

standard library https://pkg.go.dev/std

go doc

Quickly refer to api docs on CLI

# list module docs/sigs (stdlib, internal)
go doc internal/logger
go doc io | bat -l go   # nicely syntax highlighted

godoc

Show website with apidocs -- standard library, used go modules, and your own package.

go install golang.org/x/tools/cmd/godoc@latest
godoc
open 'http://localhost:6060'