Skip to content
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

fix: massively improve durationRound function, add support for durations #364

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FlorianLoch
Copy link

durationRound function was quite broken in the sense it did not support time.Duration (also stated in the documentation).

Furthermore, I improved the algorithm and added more tests.

Nevertheless, I think this function is actually misleading - as it is more a floor than a round.
Changing that would be to invasive I guess, I therefore pointed it out in the docs.

There is one breaking change contained: so far an int64 passed into durationRound was considered a duration in nanoseconds. I am not sure that really matches the expectation of the user. Especially, as it is not consistent with duration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant