mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
Fix: tree catch-all: remove unnecessary statement
This commit is contained in:
parent
cc8646c14e
commit
90a6a2cd68
9
tree.go
9
tree.go
@ -352,15 +352,6 @@ func (n *node) insertChild(path string, fullPath string, handlers HandlersChain)
|
|||||||
panic("catch-all routes are only allowed at the end of the path in path '" + fullPath + "'")
|
panic("catch-all routes are only allowed at the end of the path in path '" + fullPath + "'")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(n.path) > 0 && n.path[len(n.path)-1] == '/' {
|
|
||||||
pathSeg := strings.SplitN(n.children[0].path, "/", 2)[0]
|
|
||||||
panic("catch-all wildcard '" + path +
|
|
||||||
"' in new path '" + fullPath +
|
|
||||||
"' conflicts with existing path segment '" + pathSeg +
|
|
||||||
"' in existing prefix '" + n.path + pathSeg +
|
|
||||||
"'")
|
|
||||||
}
|
|
||||||
|
|
||||||
// currently fixed width 1 for '/'
|
// currently fixed width 1 for '/'
|
||||||
i--
|
i--
|
||||||
if path[i] != '/' {
|
if path[i] != '/' {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user