From 3553eca27c31e9709e9831f3d26ec555b904dcd4 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Mon, 29 Oct 2018 12:06:58 +0530 Subject: [PATCH] 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 --- doc/effective_go.html | 10 ++++++---- doc/go_faq.html | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/effective_go.html b/doc/effective_go.html index 5d184b76a9..1743d0fa11 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -246,14 +246,16 @@ func Compile(str string) (*Regexp, error) {

If every doc comment begins with the name of the item it describes, -the output of godoc can usefully be run through grep. +you can use the doc +subcommand of the go tool +and run the output through grep. Imagine you couldn't remember the name "Compile" but were looking for the parsing function for regular expressions, so you ran the command,

-$ godoc regexp | grep -i parse
+$ go doc -all regexp | grep -i parse
 

@@ -264,10 +266,10 @@ which recalls the word you're looking for.

-$ 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
 $
 
diff --git a/doc/go_faq.html b/doc/go_faq.html index 6bc9d6ef15..c61dd0fc5f 100644 --- a/doc/go_faq.html +++ b/doc/go_faq.html @@ -804,7 +804,7 @@ type Fooer interface {

A type must then implement the ImplementsFooer method to be a Fooer, clearly documenting the fact and announcing it in -godoc's output. +go doc's output.