From e92283d64489126e6541d425273968d7c634146d Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 16 Mar 2021 16:17:19 +0100 Subject: [PATCH] Fix linter ignores Signed-off-by: beorn7 --- prometheus/counter_test.go | 2 +- prometheus/desc.go | 2 +- prometheus/example_metricvec_test.go | 2 +- prometheus/examples_test.go | 2 +- prometheus/histogram.go | 2 +- prometheus/histogram_test.go | 2 +- prometheus/metric.go | 2 +- prometheus/promhttp/delegator.go | 6 ++---- prometheus/promhttp/instrument_server_test.go | 6 ++---- prometheus/registry.go | 2 +- prometheus/registry_test.go | 2 +- prometheus/summary.go | 2 +- prometheus/value.go | 2 +- prometheus/wrap.go | 2 +- prometheus/wrap_test.go | 2 +- 15 files changed, 17 insertions(+), 21 deletions(-) diff --git a/prometheus/counter_test.go b/prometheus/counter_test.go index 56652a0..6b359b1 100644 --- a/prometheus/counter_test.go +++ b/prometheus/counter_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/prometheus/desc.go b/prometheus/desc.go index 957d93a..4bb816a 100644 --- a/prometheus/desc.go +++ b/prometheus/desc.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/cespare/xxhash/v2" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/model" diff --git a/prometheus/example_metricvec_test.go b/prometheus/example_metricvec_test.go index 8e893e5..54f924b 100644 --- a/prometheus/example_metricvec_test.go +++ b/prometheus/example_metricvec_test.go @@ -14,9 +14,9 @@ package prometheus_test import ( - //lint:ignore SA1019 Need to keep deprecated package for compatibility. "fmt" + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" diff --git a/prometheus/examples_test.go b/prometheus/examples_test.go index 8bc051a..a73ed18 100644 --- a/prometheus/examples_test.go +++ b/prometheus/examples_test.go @@ -22,7 +22,7 @@ import ( "strings" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/expfmt" diff --git a/prometheus/histogram.go b/prometheus/histogram.go index f71e286..3346fa1 100644 --- a/prometheus/histogram.go +++ b/prometheus/histogram.go @@ -22,7 +22,7 @@ import ( "sync/atomic" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" diff --git a/prometheus/histogram_test.go b/prometheus/histogram_test.go index e779c1a..3514e81 100644 --- a/prometheus/histogram_test.go +++ b/prometheus/histogram_test.go @@ -24,7 +24,7 @@ import ( "testing/quick" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/prometheus/metric.go b/prometheus/metric.go index bf18593..dc12191 100644 --- a/prometheus/metric.go +++ b/prometheus/metric.go @@ -17,7 +17,7 @@ import ( "strings" "time" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/model" diff --git a/prometheus/promhttp/delegator.go b/prometheus/promhttp/delegator.go index 5070e72..e7c0d05 100644 --- a/prometheus/promhttp/delegator.go +++ b/prometheus/promhttp/delegator.go @@ -83,8 +83,7 @@ type readerFromDelegator struct{ *responseWriterDelegator } type pusherDelegator struct{ *responseWriterDelegator } func (d closeNotifierDelegator) CloseNotify() <-chan bool { - //lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to - //remove support from client_golang yet. + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. return d.ResponseWriter.(http.CloseNotifier).CloseNotify() } func (d flusherDelegator) Flush() { @@ -348,8 +347,7 @@ func newDelegator(w http.ResponseWriter, observeWriteHeaderFunc func(int)) deleg } id := 0 - //lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to - //remove support from client_golang yet. + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. if _, ok := w.(http.CloseNotifier); ok { id += closeNotifier } diff --git a/prometheus/promhttp/instrument_server_test.go b/prometheus/promhttp/instrument_server_test.go index 07387f3..545ae4c 100644 --- a/prometheus/promhttp/instrument_server_test.go +++ b/prometheus/promhttp/instrument_server_test.go @@ -319,8 +319,7 @@ func (t *testFlusher) Flush() { t.flushCalled = true } func TestInterfaceUpgrade(t *testing.T) { w := &testResponseWriter{} d := newDelegator(w, nil) - //lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to - //remove support from client_golang yet. + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. d.(http.CloseNotifier).CloseNotify() if !w.closeNotifyCalled { t.Error("CloseNotify not called") @@ -339,8 +338,7 @@ func TestInterfaceUpgrade(t *testing.T) { f := &testFlusher{} d = newDelegator(f, nil) - //lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to - //remove support from client_golang yet. + //nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users. if _, ok := d.(http.CloseNotifier); ok { t.Error("delegator unexpectedly implements http.CloseNotifier") } diff --git a/prometheus/registry.go b/prometheus/registry.go index 48f5ef9..383a7f5 100644 --- a/prometheus/registry.go +++ b/prometheus/registry.go @@ -26,7 +26,7 @@ import ( "unicode/utf8" "github.com/cespare/xxhash/v2" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/expfmt" diff --git a/prometheus/registry_test.go b/prometheus/registry_test.go index 48596cd..0ff7a64 100644 --- a/prometheus/registry_test.go +++ b/prometheus/registry_test.go @@ -33,7 +33,7 @@ import ( dto "github.com/prometheus/client_model/go" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/prometheus/common/expfmt" diff --git a/prometheus/summary.go b/prometheus/summary.go index cf70071..fb5ce22 100644 --- a/prometheus/summary.go +++ b/prometheus/summary.go @@ -23,7 +23,7 @@ import ( "time" "github.com/beorn7/perks/quantile" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" diff --git a/prometheus/value.go b/prometheus/value.go index 8304de4..c778711 100644 --- a/prometheus/value.go +++ b/prometheus/value.go @@ -19,7 +19,7 @@ import ( "time" "unicode/utf8" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/prometheus/wrap.go b/prometheus/wrap.go index c1b12f0..74ee932 100644 --- a/prometheus/wrap.go +++ b/prometheus/wrap.go @@ -17,7 +17,7 @@ import ( "fmt" "sort" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go" diff --git a/prometheus/wrap_test.go b/prometheus/wrap_test.go index 003544e..8bd5e60 100644 --- a/prometheus/wrap_test.go +++ b/prometheus/wrap_test.go @@ -19,7 +19,7 @@ import ( "strings" "testing" - //lint:ignore SA1019 Need to keep deprecated package for compatibility. + //nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility. "github.com/golang/protobuf/proto" dto "github.com/prometheus/client_model/go"