Skip to content

Commit

Permalink
Merge pull request #844 from prometheus/repo_sync
Browse files Browse the repository at this point in the history
Synchronize common files from prometheus/prometheus
  • Loading branch information
beorn7 committed Mar 16, 2021
2 parents 3cd3985 + e92283d commit 4fbf74e
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_

GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.18.0
GOLANGCI_LINT_VERSION ?= v1.36.0
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
# windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))
Expand Down
2 changes: 1 addition & 1 deletion prometheus/counter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/desc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/example_metricvec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion prometheus/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion prometheus/histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 2 additions & 4 deletions prometheus/promhttp/delegator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 2 additions & 4 deletions prometheus/promhttp/instrument_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion prometheus/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion prometheus/value.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion prometheus/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion prometheus/wrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4fbf74e

Please sign in to comment.