Skip to content

Commit d4dbd83

Browse files
edwingengedwingeng
andauthored
fix a bug where AdvanceNext unlocks twice (#10)
Co-authored-by: edwingeng <[email protected]>
1 parent 7f10f7f commit d4dbd83

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mock.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ func (m *Mock) AdvanceNext() (time.Duration, AdvanceWaiter) {
349349
defer close(w.ch)
350350
defer m.mu.Unlock()
351351
m.tb.Error("cannot AdvanceNext because there are no timers or tickers running")
352+
return 0, w
352353
}
353354
d := m.nextTime.Sub(m.cur)
354355
m.cur = m.nextTime

0 commit comments

Comments
 (0)