Skip to content

Commit df0e8e2

Browse files
authored
Merge pull request #743 from prometheus/beorn7/ci
Update to golangci-lint v2
2 parents ce117f7 + 1f8503f commit df0e8e2

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: sudo apt-get update && sudo apt-get -y install libsnmp-dev
3434
if: github.repository == 'prometheus/snmp_exporter'
3535
- name: Lint
36-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
36+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3737
with:
3838
args: --verbose
39-
version: v1.64.6
39+
version: v2.0.2

.golangci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
---
2-
# Run only staticcheck for now. Additional linters will be enabled one-by-one.
1+
version: "2"
32
linters:
3+
default: none
44
enable:
55
- staticcheck
6-
disable-all: true

Makefile.common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
6161
SKIP_GOLANGCI_LINT :=
6262
GOLANGCI_LINT :=
6363
GOLANGCI_LINT_OPTS ?=
64-
GOLANGCI_LINT_VERSION ?= v1.64.6
64+
GOLANGCI_LINT_VERSION ?= v2.0.2
6565
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64.
6666
# windows isn't included here because of the path separator being different.
6767
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))

handler/handler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ func verifyMetricFamily(t *testing.T, expText string, got *dto.MetricFamily) {
979979
t.Errorf("unexpected error marshaling MetricFamily %v", exp)
980980
}
981981

982-
if bytes.Compare(expProto, gotProto) != 0 {
982+
if !bytes.Equal(expProto, gotProto) {
983983
t.Errorf("Wanted metric family %v, got %v.", exp, got)
984984
}
985985
}

0 commit comments

Comments
 (0)