Skip to content

Commit e92283d

Browse files
committed
Fix linter ignores
Signed-off-by: beorn7 <[email protected]>
1 parent fbc3e40 commit e92283d

15 files changed

+17
-21
lines changed

prometheus/counter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"testing"
2020
"time"
2121

22-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
22+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2323
"github.com/golang/protobuf/proto"
2424
"github.com/golang/protobuf/ptypes"
2525

prometheus/desc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121

2222
"github.com/cespare/xxhash/v2"
23-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
23+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2424
"github.com/golang/protobuf/proto"
2525
"github.com/prometheus/common/model"
2626

prometheus/example_metricvec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
package prometheus_test
1515

1616
import (
17-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
1817
"fmt"
1918

19+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2020
"github.com/golang/protobuf/proto"
2121

2222
dto "github.com/prometheus/client_model/go"

prometheus/examples_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
"time"
2424

25-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
25+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2626
"github.com/golang/protobuf/proto"
2727
"github.com/prometheus/common/expfmt"
2828

prometheus/histogram.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"sync/atomic"
2323
"time"
2424

25-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
25+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2626
"github.com/golang/protobuf/proto"
2727

2828
dto "github.com/prometheus/client_model/go"

prometheus/histogram_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"testing/quick"
2525
"time"
2626

27-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
27+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2828
"github.com/golang/protobuf/proto"
2929
"github.com/golang/protobuf/ptypes"
3030

prometheus/metric.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"strings"
1818
"time"
1919

20-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
20+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
2121
"github.com/golang/protobuf/proto"
2222
"github.com/prometheus/common/model"
2323

prometheus/promhttp/delegator.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ type readerFromDelegator struct{ *responseWriterDelegator }
8383
type pusherDelegator struct{ *responseWriterDelegator }
8484

8585
func (d closeNotifierDelegator) CloseNotify() <-chan bool {
86-
//lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to
87-
//remove support from client_golang yet.
86+
//nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users.
8887
return d.ResponseWriter.(http.CloseNotifier).CloseNotify()
8988
}
9089
func (d flusherDelegator) Flush() {
@@ -348,8 +347,7 @@ func newDelegator(w http.ResponseWriter, observeWriteHeaderFunc func(int)) deleg
348347
}
349348

350349
id := 0
351-
//lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to
352-
//remove support from client_golang yet.
350+
//nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users.
353351
if _, ok := w.(http.CloseNotifier); ok {
354352
id += closeNotifier
355353
}

prometheus/promhttp/instrument_server_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,7 @@ func (t *testFlusher) Flush() { t.flushCalled = true }
319319
func TestInterfaceUpgrade(t *testing.T) {
320320
w := &testResponseWriter{}
321321
d := newDelegator(w, nil)
322-
//lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to
323-
//remove support from client_golang yet.
322+
//nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users.
324323
d.(http.CloseNotifier).CloseNotify()
325324
if !w.closeNotifyCalled {
326325
t.Error("CloseNotify not called")
@@ -339,8 +338,7 @@ func TestInterfaceUpgrade(t *testing.T) {
339338

340339
f := &testFlusher{}
341340
d = newDelegator(f, nil)
342-
//lint:ignore SA1019 http.CloseNotifier is deprecated but we don't want to
343-
//remove support from client_golang yet.
341+
//nolint:staticcheck // Ignore SA1019. http.CloseNotifier is deprecated but we keep it here to not break existing users.
344342
if _, ok := d.(http.CloseNotifier); ok {
345343
t.Error("delegator unexpectedly implements http.CloseNotifier")
346344
}

prometheus/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"unicode/utf8"
2727

2828
"github.com/cespare/xxhash/v2"
29-
//lint:ignore SA1019 Need to keep deprecated package for compatibility.
29+
//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
3030
"github.com/golang/protobuf/proto"
3131
"github.com/prometheus/common/expfmt"
3232

0 commit comments

Comments
 (0)