From: Rob Pike Date: Mon, 13 Jul 2015 01:13:15 +0000 (+1000) Subject: time: document that time.Tick creates an unrecoverable resource X-Git-Tag: go1.5beta2~92 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a3985e400f1afe6f6640b03dceb4ef8396a2763a;p=gostls13.git time: document that time.Tick creates an unrecoverable resource Fixes #11662. Change-Id: I8839b48a1cd3da4c29b6def03cb0c74c1c12942e Reviewed-on: https://go-review.googlesource.com/12066 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/time/tick.go b/src/time/tick.go index 19007841e1..196e8ac61a 100644 --- a/src/time/tick.go +++ b/src/time/tick.go @@ -47,7 +47,9 @@ func (t *Ticker) Stop() { } // Tick is a convenience wrapper for NewTicker providing access to the ticking -// channel only. Useful for clients that have no need to shut down the ticker. +// 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". func Tick(d Duration) <-chan Time { if d <= 0 { return nil