time: clarify that Reset
can be called after Stop
in Ticker
documentation
#72968
Labels
Documentation
Issues describing a change to documentation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I noticed that the current documentation for
time.Ticker
doesn't clearly mention that you can callReset
even after stopping the ticker withStop
. TheReset
method was added later, but when it was introduced, the documentation forStop
was not updated accordingly. The current documentation suggests that the main reason the channel is not closed is to prevent a concurrent goroutine reading from the channel from seeing an erroneous “tick.” However, after the introduction ofReset
, the primary reason for keeping the channel open is actually to allow a subsequent reset.It would be great to update the docs to explicitly state that
Reset
can be used on a ticker even afterStop
has been called, and that the channel isn't closed for that reason.The text was updated successfully, but these errors were encountered: