From 81e8552571297b1db33b48e96210e7f3c15a9a09 Mon Sep 17 00:00:00 2001 From: De Ville Weppenaar Date: Mon, 17 Oct 2022 17:08:41 -0700 Subject: [PATCH] expose LookupResult params field --- router.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/router.go b/router.go index 5969d59..08e8aef 100644 --- a/router.go +++ b/router.go @@ -55,7 +55,8 @@ type LookupResult struct { // will also be used in the case StatusCode int handler HandlerFunc - params map[string]string + // Params represents the key value pairs of the path parameters. + Params map[string]string leafHandler map[string]HandlerFunc // Only has a value when StatusCode is MethodNotAllowed. } @@ -249,7 +250,7 @@ func (t *TreeMux) ServeLookupResult(w http.ResponseWriter, r *http.Request, lr L } } else { r = t.setDefaultRequestContext(r) - lr.handler(w, r, lr.params) + lr.handler(w, r, lr.Params) } }