chore: fix warnings (#3989)

This commit is contained in:
Kevin Wan
2024-03-08 22:35:17 +08:00
committed by GitHub
parent 69bb746a1d
commit 159ecb7386
32 changed files with 64 additions and 61 deletions

View File

@@ -125,7 +125,7 @@ func (lim *TokenLimiter) reserveN(ctx context.Context, now time.Time, n int) boo
})
// redis allowed == false
// Lua boolean false -> r Nil bulk reply
if err == redis.Nil {
if errors.Is(err, redis.Nil) {
return false
}
if errors.Is(err, context.DeadlineExceeded) || errors.Is(err, context.Canceled) {