Skip to content
Merged
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
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ formatters:
- default
- prefix(github.com/prometheus/common)
gofumpt:
module-path: github.com/prometheus/common
extra-rules: true
goimports:
local-prefixes:
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