Update Walk to match all subrouters
Matches all routes instead of just routes with paths. Fixes #261
This commit is contained in:
committed by
Kamil Kisiel
parent
bcd8bc72b0
commit
a322b2c2ec
4
mux.go
4
mux.go
@@ -299,10 +299,6 @@ type WalkFunc func(route *Route, router *Router, ancestors []*Route) error
|
||||
|
||||
func (r *Router) walk(walkFn WalkFunc, ancestors []*Route) error {
|
||||
for _, t := range r.routes {
|
||||
if t.regexp == nil || t.regexp.path == nil || t.regexp.path.template == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
err := walkFn(t, r, ancestors)
|
||||
if err == SkipRouter {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user