commit | 772484ea383fac83b7da05684a96ae628b251bcd | [log] [tgz] |
---|---|---|
author | James Lees <jameslees@monzo.com> | Fri Jul 26 09:05:17 2024 +0100 |
committer | Gopher Robot <gobot@golang.org> | Tue Oct 01 18:16:11 2024 +0000 |
tree | 09383df1d682f0319dea65727baa8a1577e451a5 | |
parent | 5d9ef583af632a0fcf95276fb38326f695c4fd5f [diff] |
x/time/rate: correctly handle 0 limits Decrementing the burst in the reserveN method will frequently lead to us setting the burst to 0 which makes the limiter mostly unusable. This code was originally added in https://go.dev/cl/323429 to fix #39984 but the implementation introduced a different bug. To avoid regressing to the behaviour described in #39984, pre-fill the limiter to the burst value in the constructor. Fixes #68541 Change-Id: Iab3b85d548a44fcb2d058336e5bbf11b19ea67b1 Reviewed-on: https://go-review.googlesource.com/c/time/+/600876 Reviewed-by: Sameer Ajmani <sameer@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Sameer Ajmani <sameer@golang.org>
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.