You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stdhttp: Receive a mux as interface instead of *http.ServeMux #1718
I'm currently implementing open-telemetry, and I want to have the route pattern as part of the operation name.
I would be able to get the method and route pattern by injecting a custom ServeMux during the handler initialization.
Following the open-closed principle, you should accept interfaces and return structs. Would it be possible to accept a mux interface instead of the *http.ServeMux struct?
I volunteer myself for implementing it if approved.
Activity
jamietanna commentedon Aug 9, 2024
Would we see this as a breaking change? If so, it's something we can control via a flag.
It sounds reasonable though!
sonalys commentedon Aug 9, 2024
It's not a breaking change. You would simply replace the struct with the expectations of what the struct should implement
jamietanna commentedon Aug 9, 2024
Cool! Yeah we're happy to accept a PR for IT, hopefully can squeeze into the next release (ETA unknown)
sonalys commentedon Aug 9, 2024
@jamietanna I opened a Pull Request at #1720
feat(std-http): accept Mux as interface instead of *http.ServeMux (oa…