Skip to content

Commit 1a6dc3c

Browse files
author
coldstar
committed
fix route error with params has no child
1 parent 3139cfb commit 1a6dc3c

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

tree.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,7 @@ func (t *Tree) Match(method, pattern string, c *Context) ([]HandlerFunc, string)
133133
case leafKindParam:
134134
// params route
135135
l = len(pattern)
136-
if current.childrenNum == 0 {
137-
i = l
138-
} else {
139-
for i = 0; i < l && pattern[i] != '/'; i++ {
140-
}
136+
for i = 0; i < l && pattern[i] != '/'; i++ {
141137
}
142138
c.SetParam(current.param, pattern[:i])
143139
pattern = pattern[i:]

0 commit comments

Comments
 (0)