summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-09-07 13:32:37 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-09-07 13:32:37 +0200
commit98e85b6bd755791b8571843c95b443122760057e (patch)
treed6c7b14f5e02934f8ada71ffee2810ffcc560a25
parentacb7a82e95556748afbc61bb8eb1d5d98a2c98c6 (diff)
Cleanup
-rw-r--r--main.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.go b/main.go
index 84cb2a7..99480f0 100644
--- a/main.go
+++ b/main.go
@@ -35,6 +35,7 @@ func seed(N *big.Int) (<-chan *big.Int, <-chan *big.Int) {
nxt := make(chan *big.Int)
go func(c chan *big.Int, n, step *big.Int) {
+ defer close(c)
for {
// search next prime
n.Add(n, step)
@@ -46,6 +47,7 @@ func seed(N *big.Int) (<-chan *big.Int, <-chan *big.Int) {
prv := make(chan *big.Int)
go func(c chan *big.Int, n, step *big.Int) {
+ defer close(c)
for {
// search previous prime
n.Sub(n, step)