mirror of
https://github.com/golang/go
synced 2024-11-02 13:42:29 +00:00
time: document Tick will return nil if d <= 0
Fixes #14557. Change-Id: I9610b79aafe9c15f9c998739b586fd0b41b90d70 Reviewed-on: https://go-review.googlesource.com/20031 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
1b417e20ff
commit
28ce6f3600
1 changed files with 1 additions and 0 deletions
|
@ -50,6 +50,7 @@ func (t *Ticker) Stop() {
|
|||
// channel only. While Tick is useful for clients that have no need to shut down
|
||||
// the Ticker, be aware that without a way to shut it down the underlying
|
||||
// Ticker cannot be recovered by the garbage collector; it "leaks".
|
||||
// Unlike NewTicker, Tick will return nil if d <= 0.
|
||||
func Tick(d Duration) <-chan Time {
|
||||
if d <= 0 {
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue