commit | 6d3f0bb11be5e03f8353894b7240e7d793e40a8f | [log] [tgz] |
---|---|---|
author | Eric Lagergren <eric@ericlagergren.com> | Sat Oct 12 23:13:57 2019 -0700 |
committer | Emmanuel Odeke <emm.odeke@gmail.com> | Wed Oct 23 06:52:45 2019 +0000 |
tree | 2cae15672f76393f6e561376682774ce0fcc8c6b | |
parent | c4c64cad1fd0a1a8dab2523e04e61d35308e131e [diff] |
rate: fix rounding error in tokensFromDuration tokensFromDuration performs a unit conversion by multiplying the limit by the duration in seconds. Make tokensFromDuration perform conversion by unit-wise multiplication of limit by seconds and nanoseconds, instead of the conversion to time.(Duration).Seconds that truncated the nanoseconds. Fixes golang/go#34861 Change-Id: I94d290d3e32a87541d1702f2b58180270e1a9e96 Reviewed-on: https://go-review.googlesource.com/c/time/+/200900 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This repository provides supplementary Go time packages.
The easiest way to install is to run go get -u golang.org/x/time
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/time
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/time:” in the subject line, so it is easy to find.