Update golangci-lint to v1.62.2, fix issues (#32845)

Update it and fix new issues related to `redefines-builtin-id`
This commit is contained in:
silverwind 2024-12-15 03:31:07 +01:00 committed by GitHub
parent 7616aeb2ea
commit 1cfb718976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 36 additions and 36 deletions

View file

@ -35,18 +35,18 @@ func BoolFieldQuery(value bool, field string) *query.BoolFieldQuery {
return q
}
func NumericRangeInclusiveQuery(min, max optional.Option[int64], field string) *query.NumericRangeQuery {
func NumericRangeInclusiveQuery(minOption, maxOption optional.Option[int64], field string) *query.NumericRangeQuery {
var minF, maxF *float64
var minI, maxI *bool
if min.Has() {
if minOption.Has() {
minF = new(float64)
*minF = float64(min.Value())
*minF = float64(minOption.Value())
minI = new(bool)
*minI = true
}
if max.Has() {
if maxOption.Has() {
maxF = new(float64)
*maxF = float64(max.Value())
*maxF = float64(maxOption.Value())
maxI = new(bool)
*maxI = true
}

View file

@ -10,12 +10,12 @@ import (
)
// ParsePaginator parses a db.Paginator into a skip and limit
func ParsePaginator(paginator *db.ListOptions, max ...int) (int, int) {
func ParsePaginator(paginator *db.ListOptions, maxNums ...int) (int, int) {
// Use a very large number to indicate no limit
unlimited := math.MaxInt32
if len(max) > 0 {
if len(maxNums) > 0 {
// Some indexer engines have a limit on the page size, respect that
unlimited = max[0]
unlimited = maxNums[0]
}
if paginator == nil || paginator.IsListAll() {