mirror of https://github.com/golang/go.git
time: no need to wrap error with errors.New
This commit is contained in:
parent
de6abd7889
commit
45e3224f9a
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
package time
|
||||
|
||||
import "errors"
|
||||
|
||||
// A Ticker holds a channel that delivers “ticks” of a clock
|
||||
// at intervals.
|
||||
type Ticker struct {
|
||||
|
|
@ -21,7 +19,7 @@ type Ticker struct {
|
|||
// panic. Stop the ticker to release associated resources.
|
||||
func NewTicker(d Duration) *Ticker {
|
||||
if d <= 0 {
|
||||
panic(errors.New("non-positive interval for NewTicker"))
|
||||
panic("non-positive interval for NewTicker")
|
||||
}
|
||||
// Give the channel a 1-element time buffer.
|
||||
// If the client falls behind while reading, we drop ticks
|
||||
|
|
|
|||
Loading…
Reference in New Issue