@@ -254,7 +254,7 @@ func TestRotatingTokenBucketLimiterCollisionAvoidance(t *testing.T) {
254254
255255 // After rotation, new seed should resolve collision
256256 tick (rotationRate + 1 * time .Millisecond )
257-
257+
258258 // Wait for some token refill as well
259259 tick (2 * time .Second )
260260
@@ -285,7 +285,7 @@ func TestRotatingTokenBucketLimiterTokenPreservation(t *testing.T) {
285285 id := []byte ("preservation-test" )
286286
287287 // Take some tokens but not all
288- tokensToTake := int (rotatingBurstCapacity ) / 2 // Take half of available calls
288+ tokensToTake := int (rotatingBurstCapacity ) / 2 // Take half of available calls
289289 for i := 0 ; i < tokensToTake ; i ++ {
290290 if ! limiter .TakeToken (id ) {
291291 t .Errorf ("Should be able to take token %d" , i )
@@ -464,11 +464,11 @@ func TestRotatingTokenBucketLimiterDifferentIDs(t *testing.T) {
464464 pair := limiter .load (nowfn ())
465465 index1 := pair .checked .index (id1 )
466466 index2 := pair .checked .index (id2 )
467-
467+
468468 if index1 == index2 {
469469 // Hash collision case - IDs share the same bucket
470470 t .Logf ("Hash collision detected: both IDs map to bucket %d" , index1 )
471-
471+
472472 // With collision, they share tokens from the same bucket
473473 // We can make burstCapacity total calls between both IDs
474474 totalCalls := 0
@@ -484,7 +484,7 @@ func TestRotatingTokenBucketLimiterDifferentIDs(t *testing.T) {
484484 break
485485 }
486486 }
487-
487+
488488 // Both should now be rate limited (sharing exhausted bucket)
489489 if limiter .TakeToken (id1 ) {
490490 t .Error ("id1 should be rate limited after bucket exhaustion" )
@@ -495,7 +495,7 @@ func TestRotatingTokenBucketLimiterDifferentIDs(t *testing.T) {
495495 } else {
496496 // No collision case - IDs have independent buckets
497497 t .Logf ("No collision: id1 maps to bucket %d, id2 maps to bucket %d" , index1 , index2 )
498-
498+
499499 // Each ID should have independent rate limiting (make burstCapacity calls each)
500500 for i := 0 ; i < int (rotatingBurstCapacity ); i ++ {
501501 if ! limiter .TakeToken (id1 ) {
@@ -566,4 +566,4 @@ func BenchmarkRotatingTokenBucketLimiterConcurrent(b *testing.B) {
566566 limiter .TakeToken (id )
567567 }
568568 })
569- }
569+ }
0 commit comments