mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-19 07:38:57 +08:00
refactor
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
9b0fe9690a
commit
e0c3f7978b
5
tree.go
5
tree.go
@ -710,7 +710,9 @@ walk: // Outer loop for walking the tree
|
|||||||
|
|
||||||
if n.handlers != nil {
|
if n.handlers != nil {
|
||||||
return ciPath
|
return ciPath
|
||||||
} else if fixTrailingSlash && len(n.children) == 1 {
|
}
|
||||||
|
|
||||||
|
if fixTrailingSlash && len(n.children) == 1 {
|
||||||
// No handle found. Check if a handle for this path + a
|
// No handle found. Check if a handle for this path + a
|
||||||
// trailing slash exists
|
// trailing slash exists
|
||||||
n = n.children[0]
|
n = n.children[0]
|
||||||
@ -718,6 +720,7 @@ walk: // Outer loop for walking the tree
|
|||||||
return append(ciPath, '/')
|
return append(ciPath, '/')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
case catchAll:
|
case catchAll:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user