aboutsummaryrefslogtreecommitdiffstats
path: root/modules/indexer
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2024-12-15 03:31:07 +0100
committerGitHub <noreply@github.com>2024-12-15 02:31:07 +0000
commit1cfb718976e2db517da0e76bda835edd9df1fabd (patch)
tree556f0e895ce6d6f35d57266ea9c51e68c7f89ce6 /modules/indexer
parent7616aeb2ea2a02c15480dcd4a232e98081569690 (diff)
downloadgitea-1cfb718976e2db517da0e76bda835edd9df1fabd.tar.gz
gitea-1cfb718976e2db517da0e76bda835edd9df1fabd.zip
Update golangci-lint to v1.62.2, fix issues (#32845)
Update it and fix new issues related to `redefines-builtin-id`
Diffstat (limited to 'modules/indexer')
-rw-r--r--modules/indexer/internal/bleve/query.go10
-rw-r--r--modules/indexer/internal/paginator.go6
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/indexer/internal/bleve/query.go b/modules/indexer/internal/bleve/query.go
index 21422b281c..1b18ca1a77 100644
--- a/modules/indexer/internal/bleve/query.go
+++ b/modules/indexer/internal/bleve/query.go
@@ -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
}
diff --git a/modules/indexer/internal/paginator.go b/modules/indexer/internal/paginator.go
index ee204bf047..f1e19740eb 100644
--- a/modules/indexer/internal/paginator.go
+++ b/modules/indexer/internal/paginator.go
@@ -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() {