Skip to content

time: Tick and NewTicker inconsistency #14557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
justinmayhew opened this issue Feb 29, 2016 · 1 comment
Closed

time: Tick and NewTicker inconsistency #14557

justinmayhew opened this issue Feb 29, 2016 · 1 comment
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Milestone

Comments

@justinmayhew
Copy link

NewTicker will panic if the duration isn't greater than zero, while Tick will return nil.

Ideally Tick would panic as well but that could potentially break some code relying on this inconsistency. This special case should be documented as it's definitely not something you'd expect from reading the current Tick documentation.

@ianlancetaylor ianlancetaylor added the Documentation Issues describing a change to documentation. label Feb 29, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Feb 29, 2016
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/20031 mentions this issue.

@golang golang locked and limited conversation to collaborators Feb 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants