@@ -59,7 +59,7 @@ func setup(t *testing.T) (context.Context, map[string]*Limiter, *TransactionBuil
5959 }, newTestTransactionBuilder (t ), clk , randIP .String ()
6060}
6161
62- func mustReset (t * testing.T , l * Limiter , ctx context.Context , limit * Limit , bucketKey string ) {
62+ func resetBucket (t * testing.T , l * Limiter , ctx context.Context , limit * Limit , bucketKey string ) {
6363 t .Helper ()
6464 txn , err := newResetTransaction (limit , bucketKey )
6565 test .AssertNotError (t , err , "txn should be valid" )
@@ -161,8 +161,8 @@ func TestLimiter_CheckWithLimitOverrides(t *testing.T) {
161161 test .AssertEquals (t , d .resetIn , time .Millisecond * 50 )
162162
163163 // Reset between tests.
164- mustReset (t , l , testCtx , overriddenLimit , overriddenBucketKey )
165- mustReset (t , l , testCtx , normalLimit , normalBucketKey )
164+ resetBucket (t , l , testCtx , overriddenLimit , overriddenBucketKey )
165+ resetBucket (t , l , testCtx , normalLimit , normalBucketKey )
166166
167167 // Spend the same bucket but in a batch with a Transaction that is
168168 // check-only. This should succeed, but the decision should reflect
@@ -244,7 +244,7 @@ func TestLimiter_CheckWithLimitOverrides(t *testing.T) {
244244 test .AssertEquals (t , d .resetIn , time .Millisecond * 50 )
245245
246246 // Reset between tests.
247- mustReset (t , l , testCtx , overriddenLimit , overriddenBucketKey )
247+ resetBucket (t , l , testCtx , overriddenLimit , overriddenBucketKey )
248248 })
249249 }
250250}
@@ -283,7 +283,7 @@ func TestLimiter_InitializationViaCheckAndSpend(t *testing.T) {
283283 test .AssertEquals (t , d .retryIn , time .Duration (0 ))
284284
285285 // Reset our bucket.
286- mustReset (t , l , testCtx , limit , bucketKey )
286+ resetBucket (t , l , testCtx , limit , bucketKey )
287287
288288 // Similar to above, but we'll use Spend() to actually initialize
289289 // the bucket. Spend should return the same result as Check.
@@ -404,7 +404,7 @@ func TestLimiter_RefundAndReset(t *testing.T) {
404404 test .AssertEquals (t , d .remaining , int64 (0 ))
405405 test .AssertEquals (t , d .resetIn , time .Second )
406406
407- mustReset (t , l , testCtx , limit , bucketKey )
407+ resetBucket (t , l , testCtx , limit , bucketKey )
408408
409409 // Attempt to spend 20 more requests, this should succeed.
410410 d , err = l .Spend (testCtx , txn20 )
0 commit comments