Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
Signed-off-by: Caleb Lloyd <[email protected]>
  • Loading branch information
Caleb Lloyd committed Mar 7, 2024
1 parent c32e1d6 commit b9672ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
--disable gocritic \
--enable stylecheck \
--enable unconvert \
--enable gocyclo \
--enable gofmt \
--enable misspell \
--enable unparam \
Expand Down
1 change: 0 additions & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 3 additions & 3 deletions surveyor/collector_statz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion surveyor/collector_statz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b9672ad

Please sign in to comment.