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.
durationRound
function was quite broken in the sense it did not supporttime.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 around
. 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 intodurationRound
was considered a duration in nanoseconds. I am not sure that really matches the expectation of the user. Especially, as it is not consistent withduration
.