From 42a99047caf2db7cfaf4901ec69e5dcd17d76b76 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 16 Sep 2008 19:33:40 -0700 Subject: update tests to new communications syntax powser1.go has not been tested - waiting for compiler to catch up R=ken OCL=15415 CL=15415 --- test/sieve.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/sieve.go') diff --git a/test/sieve.go b/test/sieve.go index 98af979f1..998c4be66 100644 --- a/test/sieve.go +++ b/test/sieve.go @@ -7,19 +7,19 @@ package main // Send the sequence 2, 3, 4, ... to channel 'ch'. -func Generate(ch *chan-< int) { +func Generate(ch *chan<- int) { for i := 2; ; i++ { - ch -< i // Send 'i' to channel 'ch'. + ch <- i // Send 'i' to channel 'ch'. } } // 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 *<-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