Skip to content

Commit 3c7b448

Browse files
committed
fix lints
1 parent 5e0cf11 commit 3c7b448

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

clock.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ func (c *clock) Until(t time.Time) time.Duration { return time.Until(t) }
5151

5252
func (c *clock) Sleep(d time.Duration) { time.Sleep(d) }
5353

54-
func (c *clock) Tick(d time.Duration) <-chan time.Time { return time.Tick(d) }
54+
func (c *clock) Tick(d time.Duration) <-chan time.Time {
55+
//lint:ignore SA1015 we're intentionally replicating this API.
56+
return time.Tick(d)
57+
}
5558

5659
func (c *clock) Ticker(d time.Duration) *Ticker {
5760
t := time.NewTicker(d)

clock_test.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package clock
22

33
import (
44
"fmt"
5-
"os"
65
"sync"
76
"sync/atomic"
87
"testing"
@@ -215,14 +214,9 @@ func TestClock_Timer_Reset_Unlock(t *testing.T) {
215214
go func() {
216215
defer wg.Done()
217216

218-
select {
219-
case <-timer.C:
220-
timer.Reset(1 * time.Second)
221-
}
222-
223-
select {
224-
case <-timer.C:
225-
}
217+
<-timer.C
218+
timer.Reset(1 * time.Second)
219+
<-timer.C
226220
}()
227221

228222
clock.Add(2 * time.Second)
@@ -784,6 +778,3 @@ func TestMock_AfterRace(t *testing.T) {
784778
gosched()
785779
}
786780
}
787-
788-
func warn(v ...interface{}) { fmt.Fprintln(os.Stderr, v...) }
789-
func warnf(msg string, v ...interface{}) { fmt.Fprintf(os.Stderr, msg+"\n", v...) }

0 commit comments

Comments
 (0)