Skip to content

Commit d9521fe

Browse files
oschwaldclaude
andcommitted
Fix golangci-lint failures with v2.11.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1e8a209 commit d9521fe

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

main.go

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"fmt"
1616
"log"
1717
"os"
18-
"sort" //nolint:depguard // preexisting
18+
"slices"
1919
"strings"
2020

2121
"github.com/maxmind/mm-geofeed-verifier/v4/verify"
@@ -55,7 +55,7 @@ func run() error {
5555
)
5656
if err != nil {
5757
if errors.Is(err, verify.ErrInvalidGeofeed) {
58-
log.Printf( //nolint:gosec // logging verified geofeed data
58+
log.Printf(
5959
"Found %d invalid rows out of %d rows in total, examples by type:",
6060
c.Invalid,
6161
c.Total,
@@ -79,10 +79,17 @@ func run() error {
7979
for asNumber := range asnCounts {
8080
asNumbers = append(asNumbers, asNumber)
8181
}
82-
sort.Slice(
82+
slices.SortFunc(
8383
asNumbers,
84-
func(i, j int) bool {
85-
return asnCounts[asNumbers[i]] > asnCounts[asNumbers[j]]
84+
func(a, b uint) int {
85+
switch {
86+
case asnCounts[a] > asnCounts[b]:
87+
return -1
88+
case asnCounts[a] < asnCounts[b]:
89+
return 1
90+
default:
91+
return 0
92+
}
8693
},
8794
)
8895
for _, asNumber := range asNumbers {

0 commit comments

Comments
 (0)