Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Disable Router.SaveMatchedRoute by default
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Feb 5, 2020
1 parent ad95961 commit a057e20
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions route_test.go
Expand Up @@ -285,6 +285,7 @@ func ExampleRouteGroup() {

func ExampleGetRoute() {
router := NewRouter()
router.SaveMatchedRoute = true
router.Get("/posts/:page", func(_ http.ResponseWriter, r *http.Request) {
ps := GetParams(r)
page, _ := ps.Int("page")
Expand Down
1 change: 0 additions & 1 deletion router.go
Expand Up @@ -158,7 +158,6 @@ func NewRouter() *Router {
RedirectFixedPath: true,
HandleMethodNotAllowed: true,
HandleOPTIONS: true,
SaveMatchedRoute: true,
}
}

Expand Down
1 change: 1 addition & 0 deletions router_test.go
Expand Up @@ -736,6 +736,7 @@ func TestRouterMatchedRoutePath(t *testing.T) {
}

router := NewRouter()
router.SaveMatchedRoute = true
router.HandleFunc(http.MethodGet, route1, handle1)
router.HandleFunc(http.MethodGet, route2, handle2)
router.HandleFunc(http.MethodGet, route3, handle3)
Expand Down

0 comments on commit a057e20

Please sign in to comment.