Skip to content

Commit

Permalink
time: A Timer must be properly created before use (documentation).
Browse files Browse the repository at this point in the history
Fixes golang#8776.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/145710043
  • Loading branch information
griesemer authored and wheatman committed Jun 25, 2018
1 parent 093b1d4 commit e656a4e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/time/sleep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e656a4e

Please sign in to comment.