From fa7c11124a68e160a776144e83a0742639ac9a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=88=E8=99=8E?= Date: Fri, 15 Feb 2019 16:16:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96relativePat?= =?UTF-8?q?h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tree.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tree.go b/tree.go index b961e3a9..85bd7d1f 100644 --- a/tree.go +++ b/tree.go @@ -8,6 +8,7 @@ import ( "net/url" "strings" "unicode" + "fmt" ) // Param is a single URL parameter, consisting of a key and a value. @@ -379,12 +380,12 @@ walk: // Outer loop for walking the tree // If this node does not have a wildcard (param or catchAll) // child, we can just look up the next child node and continue // to walk down the tree + relativePath+=n.path if !n.wildChild { c := path[0] for i := 0; i < len(n.indices); i++ { if c == n.indices[i] { n = n.children[i] - relativePath+=n.path continue walk } }