Commit 3553eca2 authored by Agniva De Sarker's avatar Agniva De Sarker Committed by Rob Pike

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/145222Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent f6f27bfb
......@@ -246,14 +246,16 @@ func Compile(str string) (*Regexp, error) {
<p>
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
the parsing function for regular expressions, so you ran
the command,
</p>
<pre>
$ godoc regexp | grep -i parse
$ go doc -all regexp | grep -i parse
</pre>
<p>
......@@ -264,10 +266,10 @@ which recalls the word you're looking for.
</p>
<pre>
$ godoc regexp | grep parse
$ go doc -all regexp | grep -i parse
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
cannot be parsed. It simplifies safe initialization of global variables
$
</pre>
......
......@@ -804,7 +804,7 @@ type Fooer interface {
<p>
A type must then implement the <code>ImplementsFooer</code> method to be a
<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>
<pre>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment