From f04dafbe5984a2b8478478dfa7fef97e2c967d5f Mon Sep 17 00:00:00 2001 From: prombot Date: Mon, 19 Aug 2024 17:48:26 +0000 Subject: [PATCH 1/2] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 2 +- Makefile.common | 2 +- 2 files changed, 2 insertions(+), 2 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)) From f1ee7eee6087113c8a647f2c21f7c0873468c51a Mon Sep 17 00:00:00 2001 From: Julien Date: Tue, 20 Aug 2024 13:35:00 +0200 Subject: [PATCH 2/2] Fix golint ci Signed-off-by: Julien --- model/metric.go | 2 +- model/metric_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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...))) } }) }