Skip to content

Commit a07ee41

Browse files
time: add clarification to Timer.Stop documentation
Fixes #26220 Change-Id: I05703912be594d985ad3ccb3a9757ae21ec738ab GitHub-Last-Rev: e464984 GitHub-Pull-Request: #26293 Reviewed-on: https://go-review.googlesource.com/122715 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 4b74506 commit a07ee41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/time/tick.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ func NewTicker(d Duration) *Ticker {
4040
}
4141

4242
// Stop turns off a ticker. After Stop, no more ticks will be sent.
43-
// Stop does not close the channel, to prevent a read from the channel succeeding
44-
// incorrectly.
43+
// Stop does not close the channel, to prevent a concurrent goroutine
44+
// reading from the channel from seeing an erroneous "tick".
4545
func (t *Ticker) Stop() {
4646
stopTimer(&t.r)
4747
}

0 commit comments

Comments
 (0)