diff options
| author | fangguizhen <1297394526@qq.com> | 2023-01-16 17:46:20 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-01-20 01:07:08 +0000 |
| commit | f33e8f66980dc6d09f54e032266043beb2dbb75e (patch) | |
| tree | 1f08de7035988e9187ebd3091271d9e149ed9820 /src/time | |
| parent | 045b33ecfe4db7af6344cb5227c3d31501eb8cba (diff) | |
| download | go-f33e8f66980dc6d09f54e032266043beb2dbb75e.tar.xz | |
time: no need to wrap error with errors.New
Change-Id: Ibd519ed6419f8f21c89a111a0326d0788aca9d19
GitHub-Last-Rev: 45e3224f9afef57f49eebf3cbdf6b1d01cfd7346
GitHub-Pull-Request: golang/go#57819
Reviewed-on: https://go-review.googlesource.com/c/go/+/462046
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/time')
| -rw-r--r-- | src/time/tick.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/time/tick.go b/src/time/tick.go index dcfeca8783..9da16b5d58 100644 --- a/src/time/tick.go +++ b/src/time/tick.go @@ -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 |
