From: Rob Pike Date: Sun, 15 Nov 2009 20:09:59 +0000 (-0800) Subject: fix some typos in the documentation X-Git-Tag: weekly.2009-11-17~53 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=029c39f45aac070aad31d721f4b784c1981d3daa;p=gostls13.git fix some typos in the documentation Fixes #196. R=rsc https://golang.org/cl/154152 --- diff --git a/doc/effective_go.html b/doc/effective_go.html index 2d6403d0de..2c82ac91b7 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -977,14 +977,14 @@ you can pass a pointer to the array.
 func Sum(a *[3]float) (sum float) {
-	for _, v := range a {
+	for _, v := range *a {
 		sum += v
 	}
 	return
 }
 
 array := [...]float{7.0, 8.5, 9.1};
-x := sum(&array);  // Note the explicit address-of operator
+x := Sum(&array);  // Note the explicit address-of operator
 

diff --git a/doc/go_tutorial.html b/doc/go_tutorial.html index 201c503bbe..9ed408d345 100644 --- a/doc/go_tutorial.html +++ b/doc/go_tutorial.html @@ -550,7 +550,7 @@ declaration on line 31; it declares r and e to hold th both of type int (although you'd have to look at the syscall package to see that). Finally, line 35 returns two values: a pointer to the new File and the error. If syscall.Open fails, the file descriptor r will -be negative and NewFile will return nil. +be negative and newFile will return nil.

About those errors: The os library includes a general notion of an error. It's a good idea to use its facility in your own interfaces, as we do here, for @@ -1279,7 +1279,7 @@ code that invokes the operation and responds to the request: 19 }

-Line 18 defines the name binOp to be a function taking two integers and +Line 14 defines the name binOp to be a function taking two integers and returning a third.

The server routine loops forever, receiving requests and, to avoid blocking due to diff --git a/doc/go_tutorial.txt b/doc/go_tutorial.txt index 1e876d5ca0..dae3c6815e 100644 --- a/doc/go_tutorial.txt +++ b/doc/go_tutorial.txt @@ -841,7 +841,7 @@ code that invokes the operation and responds to the request: --PROG progs/server.go /type.binOp/ /^}/ -Line 18 defines the name "binOp" to be a function taking two integers and +Line 14 defines the name "binOp" to be a function taking two integers and returning a third. The "server" routine loops forever, receiving requests and, to avoid blocking due to