mirror of
https://github.com/golang/go
synced 2024-11-11 23:20:24 -07:00
doc: replace command line usages of godoc with go doc
Effective Go and the FAQ still had some instances which showed the command line usage of godoc. Changed them to use go doc. Updates #25443 Change-Id: If550963322034e6848bc466f79e968e7220e4a88 Reviewed-on: https://go-review.googlesource.com/c/145222 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
f6f27bfb97
commit
3553eca27c
@ -246,14 +246,16 @@ func Compile(str string) (*Regexp, error) {
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
If every doc comment begins with the name of the item it describes,
|
If every doc comment begins with the name of the item it describes,
|
||||||
the output of <code>godoc</code> can usefully be run through <code>grep</code>.
|
you can use the <a href="/cmd/go/#hdr-Show_documentation_for_package_or_symbol">doc</a>
|
||||||
|
subcommand of the <a href="/cmd/go/">go</a> tool
|
||||||
|
and run the output through <code>grep</code>.
|
||||||
Imagine you couldn't remember the name "Compile" but were looking for
|
Imagine you couldn't remember the name "Compile" but were looking for
|
||||||
the parsing function for regular expressions, so you ran
|
the parsing function for regular expressions, so you ran
|
||||||
the command,
|
the command,
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ godoc regexp | grep -i parse
|
$ go doc -all regexp | grep -i parse
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -264,10 +266,10 @@ which recalls the word you're looking for.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
$ godoc regexp | grep parse
|
$ go doc -all regexp | grep -i parse
|
||||||
Compile parses a regular expression and returns, if successful, a Regexp
|
Compile parses a regular expression and returns, if successful, a Regexp
|
||||||
|
MustCompile is like Compile but panics if the expression cannot be parsed.
|
||||||
parsed. It simplifies safe initialization of global variables holding
|
parsed. It simplifies safe initialization of global variables holding
|
||||||
cannot be parsed. It simplifies safe initialization of global variables
|
|
||||||
$
|
$
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
@ -804,7 +804,7 @@ type Fooer interface {
|
|||||||
<p>
|
<p>
|
||||||
A type must then implement the <code>ImplementsFooer</code> method to be a
|
A type must then implement the <code>ImplementsFooer</code> method to be a
|
||||||
<code>Fooer</code>, clearly documenting the fact and announcing it in
|
<code>Fooer</code>, clearly documenting the fact and announcing it in
|
||||||
<a href="/cmd/godoc/">godoc</a>'s output.
|
<a href="/cmd/go/#hdr-Show_documentation_for_package_or_symbol">go doc</a>'s output.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
Loading…
Reference in New Issue
Block a user