From b9672ad1370dceb8bb5b077bf859455a8763dc77 Mon Sep 17 00:00:00 2001 From: Caleb Lloyd Date: Thu, 7 Mar 2024 18:46:18 -0500 Subject: [PATCH] lint Signed-off-by: Caleb Lloyd --- .github/workflows/go.yaml | 1 - scripts/lint.sh | 1 - surveyor/collector_statz.go | 6 +++--- surveyor/collector_statz_test.go | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 53516e1..ce50592 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -35,7 +35,6 @@ jobs: --disable gocritic \ --enable stylecheck \ --enable unconvert \ - --enable gocyclo \ --enable gofmt \ --enable misspell \ --enable unparam \ diff --git a/scripts/lint.sh b/scripts/lint.sh index d0323c9..b9e0d1a 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -9,7 +9,6 @@ $(go env GOPATH)/bin/golangci-lint run \ --enable interfacer \ --enable unconvert \ --enable dupl \ - --enable gocyclo \ --enable gofmt \ --enable goimports \ --enable misspell \ diff --git a/surveyor/collector_statz.go b/surveyor/collector_statz.go index 91db7e0..c1168a8 100644 --- a/surveyor/collector_statz.go +++ b/surveyor/collector_statz.go @@ -1039,7 +1039,7 @@ func (sc *StatzCollector) Collect(ch chan<- prometheus.Metric) { pairs[i].id = rs.ID pairs[i].name = rs.Name } - sc.routeIDRemap = remapIdToIdx(pairs, sc.routeIDRemap) + sc.routeIDRemap = remapIDToIdx(pairs, sc.routeIDRemap) for _, rs := range sm.Stats.Routes { labels = sc.routeLabelValues(sm, rs) @@ -1055,7 +1055,7 @@ func (sc *StatzCollector) Collect(ch chan<- prometheus.Metric) { pairs[i].id = rs.ID pairs[i].name = rs.Name } - sc.gatewayIDRemap = remapIdToIdx(pairs, sc.gatewayIDRemap) + sc.gatewayIDRemap = remapIDToIdx(pairs, sc.gatewayIDRemap) for _, gw := range sm.Stats.Gateways { labels = sc.gatewayLabelValues(sm, gw) @@ -1225,7 +1225,7 @@ type nameIDPair struct { id uint64 } -func remapIdToIdx(pairs []nameIDPair, existingMapping map[string]map[uint64]int) map[string]map[uint64]int { +func remapIDToIdx(pairs []nameIDPair, existingMapping map[string]map[uint64]int) map[string]map[uint64]int { newMapping := make(map[string]map[uint64]int) // give existing the same idx diff --git a/surveyor/collector_statz_test.go b/surveyor/collector_statz_test.go index b3bfef8..d55097b 100644 --- a/surveyor/collector_statz_test.go +++ b/surveyor/collector_statz_test.go @@ -26,7 +26,7 @@ func TestRemapIdToIdx(t *testing.T) { {name: "c", id: 100}, } - newMapping := remapIdToIdx(pairs, existingMapping) + newMapping := remapIDToIdx(pairs, existingMapping) expected := map[string]map[uint64]int{ "a": { 100: 0,