Skip to content

Commit

Permalink
time: document Tick will return nil if d <= 0
Browse files Browse the repository at this point in the history
Fixes golang#14557.

Change-Id: I9610b79aafe9c15f9c998739b586fd0b41b90d70
Reviewed-on: https://go-review.googlesource.com/20031
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
minux committed Feb 29, 2016
1 parent 1b417e2 commit 28ce6f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/time/tick.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 28ce6f3

Please sign in to comment.