]> Cypherpunks repositories - gostls13.git/commitdiff
doc: replace command line usages of godoc with go doc
authorAgniva De Sarker <agnivade@yahoo.co.in>
Mon, 29 Oct 2018 06:36:58 +0000 (12:06 +0530)
committerRob Pike <r@golang.org>
Wed, 31 Oct 2018 20:08:50 +0000 (20:08 +0000)
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>
doc/effective_go.html
doc/go_faq.html

index 5d184b76a9d84349244526f436c5585d909a895c..1743d0fa112820ebbf22cb2b0f75649667222e50 100644 (file)
@@ -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>
 
index 6bc9d6ef153004bedede1e5050b2a7a37d866433..c61dd0fc5f48167834835cad7fc19bc58164f15a 100644 (file)
@@ -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>