fix golint issues in core/timex (#517)

This commit is contained in:
Kevin Wan
2021-02-24 16:27:11 +08:00
committed by GitHub
parent 04b0f26182
commit ef146cf5ba
4 changed files with 10 additions and 0 deletions

View File

@@ -8,11 +8,13 @@ import (
)
type (
// Ticker interface wraps the Chan and Stop methods.
Ticker interface {
Chan() <-chan time.Time
Stop()
}
// FakeTicker interface is used for unit testing.
FakeTicker interface {
Ticker
Done()
@@ -30,6 +32,7 @@ type (
}
)
// NewTicker returns a Ticker.
func NewTicker(d time.Duration) Ticker {
return &realTicker{
Ticker: time.NewTicker(d),
@@ -40,6 +43,7 @@ func (rt *realTicker) Chan() <-chan time.Time {
return rt.C
}
// NewFakeTicker returns a FakeTicker.
func NewFakeTicker() FakeTicker {
return &fakeTicker{
c: make(chan time.Time, 1),