Skip to content

Commit

Permalink
expose LookupResult params field
Browse files Browse the repository at this point in the history
  • Loading branch information
devilleweppenaar committed Oct 18, 2022
1 parent ce8677c commit 81e8552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 81e8552

Please sign in to comment.