From 1be999c8b6fdc8953660d3cbb4352c089019796a Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Sun, 19 Jan 2020 21:30:29 +0000 Subject: [PATCH] fix: initialize channel before the ticker --- pominal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pominal.go b/pominal.go index bcd26b4..ccc011e 100644 --- a/pominal.go +++ b/pominal.go @@ -74,9 +74,9 @@ func NewPominal(w, s, l float64, m int) Pominal { // Run Pominal func (p *Pominal) Run(infoUI, timerUI *tview.TextView) { + p.stopChan = make(chan struct{}) p.UpdateSession(infoUI) t := time.NewTicker(1 * time.Second) - p.stopChan = make(chan struct{}) infinite: for {