Skip to content

Commit 5eb64ec

Browse files
committed
remove unused channel
1 parent 1dca2c3 commit 5eb64ec

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

testutil/eventually.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func Eventually(ctx context.Context, t testing.TB, condition func(context.Contex
2727
panic("developer error: must set deadline or timeout on ctx")
2828
}
2929

30-
ch := make(chan bool, 1)
3130
ticker := time.NewTicker(tick)
3231
defer ticker.Stop()
3332
for tick := ticker.C; ; {
@@ -36,11 +35,7 @@ func Eventually(ctx context.Context, t testing.TB, condition func(context.Contex
3635
assert.NoError(t, ctx.Err(), "Eventually timed out")
3736
return false
3837
case <-tick:
39-
tick = nil
40-
ch <- condition(ctx)
41-
case v := <-ch:
42-
if v {
43-
close(ch)
38+
if condition(ctx) {
4439
return true
4540
}
4641
tick = ticker.C

0 commit comments

Comments
 (0)