chore: make error clearer (#1514)
This commit is contained in:
@@ -7,6 +7,9 @@ import (
|
||||
"github.com/zeromicro/go-zero/core/lang"
|
||||
)
|
||||
|
||||
// errTimeout indicates a timeout.
|
||||
var errTimeout = errors.New("timeout")
|
||||
|
||||
type (
|
||||
// Ticker interface wraps the Chan and Stop methods.
|
||||
Ticker interface {
|
||||
@@ -70,7 +73,7 @@ func (ft *fakeTicker) Tick() {
|
||||
func (ft *fakeTicker) Wait(d time.Duration) error {
|
||||
select {
|
||||
case <-time.After(d):
|
||||
return errors.New("timeout")
|
||||
return errTimeout
|
||||
case <-ft.done:
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user