Commit 5ad999a3 authored by Yongzheng Lai's avatar Yongzheng Lai

Update tree.go

fix routers for:
```
/topic/:id/?:auth
/topic/:id/?:auth:int
```
parent a89f14d8
......@@ -208,6 +208,11 @@ func (t *Tree) addseg(segments []string, route interface{}, wildcards []string,
} else {
t.leaves = append(t.leaves, &leafInfo{runObject: route, wildcards: wildcards})
}
for i, v := range wildcards {
if v==":" && i!=0{
t.leaves = append(t.leaves, &leafInfo{runObject: route, wildcards: wildcards[:i+1]})
}
}
} else {
seg := segments[0]
iswild, params, regexpStr := splitSegment(seg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment