Store path params in request context.

This commit is contained in:
2020-12-13 22:57:01 -08:00
parent ac8a5ff56e
commit ee0bb08b57
2 changed files with 21 additions and 9 deletions

View File

@ -246,7 +246,7 @@ func testParamValues(router Router, t *testing.T) {
reqPath := fmt.Sprintf("/users/%s/edit/%s", userID, status)
router.AddRoute(method, path, func(w http.ResponseWriter, r *http.Request) {
params := router.PathParams(r)
params := PathParams(r)
if len(params) != 2 {
t.Errorf("Received the wrong number of parameters. Expected 2, recieved %d", len(params))