time: A Timer must be properly created before use (documentation).

Fixes #8776.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/145710043
This commit is contained in:
Robert Griesemer 2014-10-01 16:44:52 -07:00
parent 7e8218aedd
commit bc89e8c575

View File

@ -43,6 +43,7 @@ func stopTimer(*runtimeTimer) bool
// The Timer type represents a single event. // The Timer type represents a single event.
// When the Timer expires, the current time will be sent on C, // When the Timer expires, the current time will be sent on C,
// unless the Timer was created by AfterFunc. // unless the Timer was created by AfterFunc.
// A Timer must be created with NewTimer or AfterFunc.
type Timer struct { type Timer struct {
C <-chan Time C <-chan Time
r runtimeTimer r runtimeTimer