mirror of
https://github.com/golang/go
synced 2024-11-22 06:24:38 -07:00
fix a couple of minor errors
SVN=126938
This commit is contained in:
parent
d0cf215bf2
commit
2fdbf0d595
@ -4,7 +4,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
package Main
|
package main
|
||||||
|
|
||||||
// Send the sequence 2, 3, 4, ... to channel 'ch'.
|
// Send the sequence 2, 3, 4, ... to channel 'ch'.
|
||||||
func Generate(ch *chan> int) {
|
func Generate(ch *chan> int) {
|
||||||
@ -30,13 +30,13 @@ func Sieve() {
|
|||||||
go Generate(ch); // Start Generate() as a subprocess.
|
go Generate(ch); // Start Generate() as a subprocess.
|
||||||
for {
|
for {
|
||||||
prime := <ch;
|
prime := <ch;
|
||||||
print "%d\n", prime;
|
print prime, "\n";
|
||||||
ch1 := new(chan int);
|
ch1 := new(chan int);
|
||||||
go Filter(ch, ch1, prime);
|
go Filter(ch, ch1, prime);
|
||||||
ch = ch1
|
ch = ch1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Main() {
|
func main() {
|
||||||
Sieve()
|
Sieve()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user