diff options
author | Rob Pike <r@golang.org> | 2008-09-16 19:40:38 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2008-09-16 19:40:38 -0700 |
commit | effe64dd61b262994b7ee18c55c4f64aa88c19d5 (patch) | |
tree | 4134100521d51a61dc0409d6f7e22421c53fbdf9 /doc/progs/sieve.go | |
parent | 42a99047caf2db7cfaf4901ec69e5dcd17d76b76 (diff) | |
download | golang-effe64dd61b262994b7ee18c55c4f64aa88c19d5.tar.gz |
update to new communications syntax
R=gri
OCL=15417
CL=15417
Diffstat (limited to 'doc/progs/sieve.go')
-rw-r--r-- | doc/progs/sieve.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/progs/sieve.go b/doc/progs/sieve.go index 60760cf4e..2ee3bb7ff 100644 --- a/doc/progs/sieve.go +++ b/doc/progs/sieve.go @@ -7,7 +7,7 @@ package main // Send the sequence 2, 3, 4, ... to channel 'ch'. func Generate(ch *chan int) { for i := 2; ; i++ { - ch -< i // Send 'i' to channel 'ch'. + ch <- i // Send 'i' to channel 'ch'. } } @@ -17,7 +17,7 @@ func Filter(in *chan int, out *chan int, prime int) { for { i := <-in // Receive value of new variable 'i' from 'in'. if i % prime != 0 { - out -< i // Send 'i' to channel 'out'. + out <- i // Send 'i' to channel 'out'. } } } |