aboutsummaryrefslogtreecommitdiff
path: root/test/sieve.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-06-06 13:28:03 -0700
committerRob Pike <r@golang.org>2008-06-06 13:28:03 -0700
commit126150d0f665e1a5a5103f85f4d7b1ff97f71f9d (patch)
tree9fc78195cd6f45b370bba69597b64afd6e0f7bb3 /test/sieve.go
parent27fb2abf76f53168862b5140df1cad95b5804fe6 (diff)
downloadgo-126150d0f665e1a5a5103f85f4d7b1ff97f71f9d.tar.gz
go-126150d0f665e1a5a5103f85f4d7b1ff97f71f9d.zip
lots of new tests
SVN=121464
Diffstat (limited to 'test/sieve.go')
-rw-r--r--test/sieve.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sieve.go b/test/sieve.go
index 1a96e601dd..c27519ab9d 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();
}