summaryrefslogtreecommitdiff
path: root/test/sieve.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-01-06 15:19:02 -0800
committerRuss Cox <rsc@golang.org>2009-01-06 15:19:02 -0800
commit19fede0efc349d1dce1b28f1be42e21b7276a44d (patch)
treef3f98baba1fdd5e0138a4875884aa85111308b3f /test/sieve.go
parent3454572242c20d34d557038e2523de084f1e26e5 (diff)
downloadgo-19fede0efc349d1dce1b28f1be42e21b7276a44d.tar.gz
new new & make
R=r OCL=22166 CL=22166
Diffstat (limited to 'test/sieve.go')
-rw-r--r--test/sieve.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sieve.go b/test/sieve.go
index 91fa6e5f0..e16345617 100644
--- a/test/sieve.go
+++ b/test/sieve.go
@@ -26,12 +26,12 @@ func Filter(in <-chan int, out chan<- int, prime int) {
// The prime sieve: Daisy-chain Filter processes together.
func Sieve() {
- ch := new(chan int); // Create a new channel.
+ ch := make(chan int); // Create a new channel.
go Generate(ch); // Start Generate() as a subprocess.
for {
prime := <-ch;
print(prime, "\n");
- ch1 := new(chan int);
+ ch1 := make(chan int);
go Filter(ch, ch1, prime);
ch = ch1
}