style: go fmt

This commit is contained in:
Trong Huu Nguyen
2026-05-26 13:27:55 +02:00
parent 8b88874ffb
commit a8c5ad891f
4 changed files with 13 additions and 9 deletions
+2 -1
View File
@@ -393,7 +393,8 @@ func TestNonNavigationalRequests(t *testing.T) {
} {
t.Run("with fetch metadata", func(t *testing.T) {
rpClient := idp.RelyingPartyClient()
resp := get(t, rpClient, idp.RelyingPartyServer.URL+path,
resp := get(
t, rpClient, idp.RelyingPartyServer.URL+path,
header{"Sec-Fetch-Mode", "cors"},
header{"Sec-Fetch-Dest", "empty"},
)
+2 -1
View File
@@ -180,7 +180,8 @@ func TestReverseProxy(t *testing.T) {
t.Run("with fetch metadata", func(t *testing.T) {
target := idp.RelyingPartyServer.URL + "/"
resp := get(t, rpClient, target,
resp := get(
t, rpClient, target,
header{"Sec-Fetch-Mode", "cors"},
header{"Sec-Fetch-Dest", "empty"},
)
+7 -6
View File
@@ -46,12 +46,13 @@ func Prometheus(provider string, buckets ...float64) *PrometheusMiddleware {
if len(buckets) == 0 {
buckets = defaultBuckets
}
m.latency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: latencyName,
Help: "How long it took to process the request, partitioned by status code, method and HTTP path.",
ConstLabels: prometheus.Labels{"service": serviceName, metrics.LabelProvider: provider},
Buckets: buckets,
},
m.latency = prometheus.NewHistogramVec(
prometheus.HistogramOpts{
Name: latencyName,
Help: "How long it took to process the request, partitioned by status code, method and HTTP path.",
ConstLabels: prometheus.Labels{"service": serviceName, metrics.LabelProvider: provider},
Buckets: buckets,
},
[]string{"code", "method", "path", "host"},
)
+2 -1
View File
@@ -60,7 +60,8 @@ func New(src Source, cfg *config.Config) chi.Router {
r := chi.NewRouter()
r.Use(middleware.CorrelationIDHandler)
if cfg.OpenTelemetry.Enabled {
r.Use(otelchi.Middleware(cfg.OpenTelemetry.ServiceName,
r.Use(otelchi.Middleware(
cfg.OpenTelemetry.ServiceName,
otelchi.WithChiRoutes(r),
otelchi.WithRequestMethodInSpanName(true),
otelchi.WithFilter(func(r *http.Request) bool {