]> Cypherpunks repositories - gostls13.git/commitdiff
time: A Timer must be properly created before use (documentation).
authorRobert Griesemer <gri@golang.org>
Wed, 1 Oct 2014 23:44:52 +0000 (16:44 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 1 Oct 2014 23:44:52 +0000 (16:44 -0700)
Fixes #8776.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/145710043

src/time/sleep.go

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