Skip to content

Commit

Permalink
Fix: tree catch-all: remove unnecessary statement
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanoGeorge committed Aug 8, 2022
1 parent cc8646c commit 90a6a2c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "'")
}

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 '/'
i--
if path[i] != '/' {
Expand Down

0 comments on commit 90a6a2c

Please sign in to comment.