Skip to content

Commit bc89e8c

Browse files
committed
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
1 parent 7e8218a commit bc89e8c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/time/sleep.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func stopTimer(*runtimeTimer) bool
4343
// The Timer type represents a single event.
4444
// When the Timer expires, the current time will be sent on C,
4545
// unless the Timer was created by AfterFunc.
46+
// A Timer must be created with NewTimer or AfterFunc.
4647
type Timer struct {
4748
C <-chan Time
4849
r runtimeTimer

0 commit comments

Comments
 (0)