-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync route tree to httprouter latest code #2368
Conversation
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2368 +/- ##
==========================================
+ Coverage 98.48% 98.63% +0.15%
==========================================
Files 41 41
Lines 2305 2349 +44
==========================================
+ Hits 2270 2317 +47
+ Misses 20 18 -2
+ Partials 15 14 -1
Continue to review full report at Codecov.
|
gin.go
Outdated
@@ -256,13 +258,20 @@ func (engine *Engine) addRoute(method, path string, handlers HandlersChain) { | |||
assert1(len(handlers) > 0, "there must be at least one handler") | |||
|
|||
debugPrintRoute(method, path, handlers) | |||
varsCount := uint16(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this zero value local var is't reassign value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thinkerou done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thinkerou done.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
tree.go
Outdated
if len(n.children) == 1 { | ||
if n.handlers != nil { | ||
return ciPath | ||
} else if fixTrailingSlash && len(n.children) == 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
instead of else if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
*Params
in context.maxParams
counts to engine