Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
# Override Go 1.18 security deprecations.
GODEBUG: "x509sha1=1,tls10default=1"
strategy:
matrix:
go:
Expand Down
9 changes: 3 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ linters:
- misspell
- modernize
- nilnesserr
# TODO(bwplotka): Enable once https://github.com/golangci/golangci-lint/issues/3228 is fixed.
# - nolintlint
- nolintlint
- perfsprint
- predeclared
- revive
Expand Down Expand Up @@ -44,9 +43,6 @@ linters:
- linters:
- gocritic
text: "appendAssign"
- linters:
- errcheck
path: _test.go
warn-unused: true
settings:
depguard:
Expand Down Expand Up @@ -177,7 +173,8 @@ formatters:
- default
- prefix(github.com/prometheus/common)
gofumpt:
extra-rules: true
extra:
group-params: true
goimports:
local-prefixes:
- github.com/prometheus/common
2 changes: 1 addition & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?= v2.12.2
GOLANGCI_LINT_VERSION ?= v2.13.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is managed and synced from upstream Prometheus.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GOLANGCI_LINT_VERSION ?= v2.13.1
GOLANGCI_LINT_VERSION ?= v2.12.2

GOLANGCI_FMT_OPTS ?=
# 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.
Expand Down
14 changes: 8 additions & 6 deletions config/http_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ type closeIdler interface {
type TLSVersion uint16

var TLSVersions = map[string]TLSVersion{
"TLS13": (TLSVersion)(tls.VersionTLS13),
"TLS12": (TLSVersion)(tls.VersionTLS12),
"TLS11": (TLSVersion)(tls.VersionTLS11),
"TLS10": (TLSVersion)(tls.VersionTLS10),
"TLS13": TLSVersion(tls.VersionTLS13),
"TLS12": TLSVersion(tls.VersionTLS12),
"TLS11": TLSVersion(tls.VersionTLS11),
"TLS10": TLSVersion(tls.VersionTLS10),
}

func (tv *TLSVersion) UnmarshalYAML(unmarshal func(any) error) error {
Expand Down Expand Up @@ -639,11 +639,13 @@ func NewRoundTripperFromConfigWithContext(ctx context.Context, cfg HTTPClientCon
dialContext = conntrack.NewDialContextFunc(
conntrack.DialWithDialContextFunc((func(context.Context, string, string) (net.Conn, error))(opts.dialContextFunc)),
conntrack.DialWithTracing(),
conntrack.DialWithName(name))
conntrack.DialWithName(name),
)
} else {
dialContext = conntrack.NewDialContextFunc(
conntrack.DialWithTracing(),
conntrack.DialWithName(name))
conntrack.DialWithName(name),
)
}

newRT := func(tlsConfig *tls.Config) (http.RoundTripper, error) {
Expand Down
2 changes: 1 addition & 1 deletion config/tls_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func TestInvalidTLSConfig(t *testing.T) {
}

func TestTLSVersionStringer(t *testing.T) {
s := (TLSVersion)(tls.VersionTLS13)
s := TLSVersion(tls.VersionTLS13)
require.Equalf(t, "TLS13", s.String(), "tls.VersionTLS13 string should be TLS13, got %s", s.String())
}

Expand Down
9 changes: 6 additions & 3 deletions route/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,20 @@ func TestInstrumentations(t *testing.T) {
func(handlerName string, handler http.HandlerFunc) http.HandlerFunc {
got = append(got, "1"+handlerName)
return handler
}).
},
).
WithInstrumentation(
func(handlerName string, handler http.HandlerFunc) http.HandlerFunc {
got = append(got, "2"+handlerName)
return handler
}).
},
).
WithInstrumentation(
func(handlerName string, handler http.HandlerFunc) http.HandlerFunc {
got = append(got, "3"+handlerName)
return handler
}),
},
),
want: []string{"1/foo", "2/foo", "3/foo"},
},
}
Expand Down
Loading