From 0603ee9879dd386da21e3a891182ba4d1d5fade7 Mon Sep 17 00:00:00 2001 From: filifa Date: Fri, 5 Sep 2025 20:49:58 -0400 Subject: [PATCH] make channels one-way --- cmd/convergents.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/convergents.go b/cmd/convergents.go index c5863ef..b7cf9d1 100644 --- a/cmd/convergents.go +++ b/cmd/convergents.go @@ -23,14 +23,14 @@ import ( "github.com/spf13/cobra" ) -func cycle(seq []*big.Int, ch chan *big.Int) { +func cycle(seq []*big.Int, ch chan<- *big.Int) { n := len(seq) for i := 0; true; i = (i + 1) % n { ch <- seq[i] } } -func gaussianBrackets(x, xprev *big.Int, seq []*big.Int, ch chan *big.Int) { +func gaussianBrackets(x, xprev *big.Int, seq []*big.Int, ch chan<- *big.Int) { c := make(chan *big.Int) go cycle(seq, c) for a := range c {