Place the unexpanded route path in the request Context
This is mostly to allow logging middleware to show the actual route matched without expanded wildcards.
Request context data can now be accessed using httptreemux.ContextData(r.Context())
, which returns an interface ContextRouteData containing the parameters and the route path. The old ContextParams
method is no longer recommended, but will continue to exist and work as before.
Thanks to @stuartclan for the suggestion and help with the implementation and review!