From ca8462095811136cfb0e55707cab4e005070ba83 Mon Sep 17 00:00:00 2001 From: Sargun Dhillon Date: Fri, 4 Dec 2020 13:07:46 -0800 Subject: [PATCH] Fix gosimple check We were doing a select without needing to. --- internal/lock/monitor_test.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/internal/lock/monitor_test.go b/internal/lock/monitor_test.go index e95e41c3a..9d2be6949 100644 --- a/internal/lock/monitor_test.go +++ b/internal/lock/monitor_test.go @@ -72,16 +72,14 @@ func TestMonitorMultipleVersions(t *testing.T) { defer lock.Unlock() subscription := mv.Subscribe() for { - select { - case <-subscription.NewValueReady(): - val := subscription.Value() - triggers = append(triggers, val.Value.(int)) - ch <- struct{}{} - if val.Value == 9 { - return - } + // Lint is wrong, we need to call the function each time to get a fresh channel. + <-subscription.NewValueReady() + val := subscription.Value() + triggers = append(triggers, val.Value.(int)) + ch <- struct{}{} + if val.Value == 9 { + return } - } }()