]> Cypherpunks repositories - gostls13.git/commitdiff
fix some typos, mostly
authorRob Pike <r@golang.org>
Tue, 30 Sep 2008 03:06:48 +0000 (20:06 -0700)
committerRob Pike <r@golang.org>
Tue, 30 Sep 2008 03:06:48 +0000 (20:06 -0700)
R=gri
OCL=16161
CL=16161

doc/go_tutorial.txt
doc/progs/sieve.go

index 7b1fe04cd964b0732daa70012e4337440bbd3a37..67db2d9f13d446a8b4b92fd66ddd550ad9e2a9f5 100644 (file)
@@ -348,7 +348,7 @@ we have a second implementation of the "Reader" interface.
 
 --PROG progs/cat_rot13.go /type.Rot13/ /end.of.Rot13/
 
-(The "rot13" function called on line 39 is trivial and not worth reproducing.)
+(The "rot13" function called on line 38 is trivial and not worth reproducing.)
 
 To use the new feature, we define a flag:
 
@@ -358,6 +358,8 @@ and use it from within a mostly unchanged "cat()" function:
 
 --PROG progs/cat_rot13.go /func.cat/ /^}/
 
+(We could also do the wrapping in "main" and leave "cat()" mostly alone, except
+for changing the type of the argument.)
 Lines 53 and 54 set it all up: If the "rot13" flag is true, wrap the "Reader"
 we received into a "Rot13" and proceed.  Note that the interface variables
 are values, not pointers: the argument is of type "Reader", not "*Reader",
@@ -374,7 +376,7 @@ Here it is in action:
 </pre>
 
 Fans of dependency injection may take cheer from how easily interfaces
-made substituting the implementation of a file descriptor.
+allow us to substitute the implementation of a file descriptor.
 
 Interfaces are a distinct feature of Go.  An interface is implemented by a
 type if the type implements all the methods declared in the interface.
@@ -526,7 +528,7 @@ With channels, it's possible to serve multiple independent client goroutines wit
 writing an actual multiplexer.  The trick is to send the server a channel in the message,
 which it will then use to reply to the original sender.
 A realistic client-server program is a lot of code, so here is a very simple substitute
-to illustrate the idea.  It starts by defining "Request" type, which embeds a channel
+to illustrate the idea.  It starts by defining "Request" type, which embeds a channel
 that will be used for the reply.
 
 --PROG progs/server.go /type.Request/ /^}/
index 2ee3bb7ff0083699f7af6cae32c41e78ed00dc72..1ee60bddfaf3de31199a2e0c02c15027130d1153 100644 (file)
@@ -13,7 +13,7 @@ func Generate(ch *chan int) {
 
 // Copy the values from channel 'in' to channel 'out',
 // removing those divisible by 'prime'.
-func Filter(in *chan int, out *chan int, prime int) {
+func Filter(in, out *chan int, prime int) {
        for {
                i := <-in  // Receive value of new variable 'i' from 'in'.
                if i % prime != 0 {