Skip to content

Commit

Permalink
fix(tree): reassign fullpath when register new node which the same cu…
Browse files Browse the repository at this point in the history
…rrent node (#2366)

* fix(tree): assign fullpath to current node by fullpath of new node if current node the same new node

* test(router-test): reverse the order when register router when test func GetFullPath

* chg(tree-test): update test case with register new route in TestRouteContextHoldsFullPath

Co-authored-by: vinhha <vinhha@vng.com.vn>
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
3 people committed May 11, 2020
1 parent d17270d commit a6e8665
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions routes_test.go
Expand Up @@ -593,6 +593,9 @@ func TestRouteContextHoldsFullPath(t *testing.T) {
"/simple-two/one-two",
"/project/:name/build/*params",
"/project/:name/bui",
"/user/:id/status",
"/user/:id",
"/user/:id/profile",
}

for _, route := range routes {
Expand Down
1 change: 1 addition & 0 deletions tree.go
Expand Up @@ -240,6 +240,7 @@ walk:
panic("handlers are already registered for path '" + fullPath + "'")
}
n.handlers = handlers
n.fullPath = fullPath
return
}
}
Expand Down

0 comments on commit a6e8665

Please sign in to comment.