fix(lint): fix all linting errors
Some checks failed
CI / Test (pull_request) Successful in 53s
CI / Lint (pull_request) Failing after 26s
CI / Build (pull_request) Successful in 39s
CI / Format Check (pull_request) Failing after 2s

- Check BindEnv return values in config.go
- Add bounds checks for int->int32/uint32 conversions to prevent overflow
- Remove unused test helper functions
This commit is contained in:
2025-11-07 09:34:22 +01:00
parent 131e44f3d4
commit e673fcae6f
7 changed files with 44 additions and 39 deletions

View File

@@ -4,6 +4,7 @@ package grpc
import (
"context"
"fmt"
"math"
auditv1 "git.dcentral.systems/toolz/goplt/api/proto/generated/audit/v1"
"git.dcentral.systems/toolz/goplt/pkg/registry"
@@ -86,9 +87,17 @@ func (c *AuditClient) Query(ctx context.Context, filters *services.AuditLogFilte
return nil, err
}
limit := filters.Limit
if limit > math.MaxInt32 {
limit = math.MaxInt32
}
offset := filters.Offset
if offset > math.MaxInt32 {
offset = math.MaxInt32
}
req := &auditv1.QueryRequest{
Limit: int32(filters.Limit),
Offset: int32(filters.Offset),
Limit: int32(limit),
Offset: int32(offset),
}
if filters.UserID != nil {