diff options
Diffstat (limited to 'test/sieve.go')
-rw-r--r-- | test/sieve.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sieve.go b/test/sieve.go index 1a96e601d..c27519ab9 100644 --- a/test/sieve.go +++ b/test/sieve.go @@ -9,7 +9,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'. } } @@ -19,7 +19,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'. } } } @@ -33,10 +33,10 @@ func Sieve() { print "%d\n", prime; ch1 := new(chan int); go Filter(ch, ch1, prime); - ch = ch1 + ch = ch1; } } func Main() { - Sieve() + Sieve(); } |