Skip to content

Commit 07d2d56

Browse files
authored
fix: tests on 32bit arch (#220)
1 parent 132186d commit 07d2d56

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ratelimit/bucketset.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ func (tbs *TokenBucketSet) GetMaxPeriod() time.Duration {
8989
// debugState returns string that reflects the current state of all buckets in
9090
// this set. It is intended to be used for debugging and testing only.
9191
func (tbs *TokenBucketSet) debugState() string {
92-
periods := sort.IntSlice(make([]int, 0, len(tbs.buckets)))
92+
periods := make([]int64, 0, len(tbs.buckets))
9393
for period := range tbs.buckets {
94-
periods = append(periods, int(period))
94+
periods = append(periods, int64(period))
9595
}
96-
sort.Sort(periods)
96+
sort.Slice(periods, func(i, j int) bool { return periods[i] < periods[j] })
9797
bucketRepr := make([]string, 0, len(tbs.buckets))
9898
for _, period := range periods {
9999
bucket := tbs.buckets[time.Duration(period)]

0 commit comments

Comments
 (0)