Skip to content

Commit

Permalink
Remove unreachable code that causes coverage failure
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-access committed Mar 21, 2021
1 parent 971818b commit 2d71324
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 0 additions & 7 deletions tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,6 @@ func (n *node) insertChild(path, fullPath string, handle Handle) {
panic("wildcards must be named with a non-empty name in path '" + fullPath + "'")
}

// Check if this node has existing wildcards which would be
// unreachable if we insert the wildcard here
if n.wildChild {
panic("wildcard segment '" + wildcard +
"' conflicts with existing children in path '" + fullPath + "'")
}

// param
if wildcard[0] == ':' {
if i > 0 {
Expand Down
1 change: 1 addition & 0 deletions tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ func TestTreeWildcardConflict(t *testing.T) {
{"/src/foo/bar", true},
{"/src1/", false},
{"/src1/*filepath", true},
{"/src2/*filepath", false},
{"/src2*filepath", true},
{"/search/:query", false},
{"/search/invalid", false},
Expand Down

0 comments on commit 2d71324

Please sign in to comment.