summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)