Skip to content

Commit

Permalink
Dust lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ypaq committed Jul 20, 2023
1 parent fd9320b commit 54bbf27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hmiddleware/httpmetrics/httpmetrics_otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func NewOTEL(p metrics.Provider) func(http.Handler) http.Handler {
if ctx.Value(chi.RouteCtxKey) != nil {
rtCtx := chi.RouteContext(ctx)
if len(rtCtx.RoutePatterns) > 0 {
// pick last route pattern as it is the one chi used
route := getRouteAsString(rtCtx.RoutePatterns)
kv := []string{routeKey, route}
labels = append(labels, kv...)
Expand All @@ -77,5 +76,5 @@ func getRouteAsString(patterns []string) string {
for _, pattern := range patterns {
result += pattern
}
return strings.Replace(result, "/*/", "/", -1)
return strings.ReplaceAll(result, "/*/", "/")
}

0 comments on commit 54bbf27

Please sign in to comment.