fix(lint): fix all linting errors
- 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:
@@ -2,6 +2,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"math"
|
||||
"context"
|
||||
|
||||
auditv1 "git.dcentral.systems/toolz/goplt/api/proto/generated/audit/v1"
|
||||
@@ -118,8 +119,12 @@ func (s *Server) Query(ctx context.Context, req *auditv1.QueryRequest) (*auditv1
|
||||
})
|
||||
}
|
||||
|
||||
total := len(protoEntries)
|
||||
if total > math.MaxInt32 {
|
||||
total = math.MaxInt32
|
||||
}
|
||||
return &auditv1.QueryResponse{
|
||||
Entries: protoEntries,
|
||||
Total: int32(len(protoEntries)), // Note: This is a simplified total, actual total would require a count query
|
||||
Total: int32(total), // Note: This is a simplified total, actual total would require a count query
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user