From effe64dd61b262994b7ee18c55c4f64aa88c19d5 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 16 Sep 2008 19:40:38 -0700 Subject: update to new communications syntax R=gri OCL=15417 CL=15417 --- doc/progs/sieve.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/progs/sieve.go') 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'. } } } -- cgit v1.2.3