From cd4bcc02f4479542b7b360049c2ce7db52d3163d Mon Sep 17 00:00:00 2001 From: Julien <291750+roidelapluie@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:59:27 +0200 Subject: [PATCH] Update golangci lint (#679) * Update common Prometheus files Signed-off-by: prombot * Fix golint ci Signed-off-by: Julien --------- Signed-off-by: prombot Signed-off-by: Julien Co-authored-by: prombot --- .github/workflows/golangci-lint.yml | 2 +- Makefile.common | 2 +- model/metric.go | 2 +- model/metric_test.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 746831a8..fc0f9c65 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -36,4 +36,4 @@ jobs: uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 with: args: --verbose - version: v1.59.1 + version: v1.60.1 diff --git a/Makefile.common b/Makefile.common index e3da72ab..2ecd5465 100644 --- a/Makefile.common +++ b/Makefile.common @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.59.1 +GOLANGCI_LINT_VERSION ?= v1.60.1 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64/arm64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) diff --git a/model/metric.go b/model/metric.go index d0117b36..c44f93f3 100644 --- a/model/metric.go +++ b/model/metric.go @@ -452,6 +452,6 @@ func ToEscapingScheme(s string) (EscapingScheme, error) { case EscapeValues: return ValueEncodingEscaping, nil default: - return NoEscaping, fmt.Errorf("unknown format scheme " + s) + return NoEscaping, fmt.Errorf("unknown format scheme %s", s) } } diff --git a/model/metric_test.go b/model/metric_test.go index 5b0fcba7..ef08a053 100644 --- a/model/metric_test.go +++ b/model/metric_test.go @@ -595,10 +595,10 @@ func TestEscapeMetricFamily(t *testing.T) { original := proto.Clone(scenario.input) got := EscapeMetricFamily(scenario.input, scenario.scheme) if !cmp.Equal(scenario.expected, got, cmpopts.IgnoreUnexported(unexportList...)) { - t.Errorf("unexpected difference in escaped output:" + cmp.Diff(scenario.expected, got, cmpopts.IgnoreUnexported(unexportList...))) + t.Errorf("unexpected difference in escaped output:\n%s", cmp.Diff(scenario.expected, got, cmpopts.IgnoreUnexported(unexportList...))) } if !cmp.Equal(scenario.input, original, cmpopts.IgnoreUnexported(unexportList...)) { - t.Errorf("input was mutated during escaping" + cmp.Diff(scenario.expected, got, cmpopts.IgnoreUnexported(unexportList...))) + t.Errorf("input was mutated during escaping:\n%s", cmp.Diff(scenario.expected, got, cmpopts.IgnoreUnexported(unexportList...))) } }) }