-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[issue-2557] Add :from-:to range route formats #2560
base: master
Are you sure you want to change the base?
Conversation
This is little bit too simple take for implementing this feature. I would say that the requirement we are talking is allowing multiple parameters per route segment where segment is string part between p.s. using new special characters in route paths like |
@aldas Thank you for your comment. the If I understood correctly, the restriction here is that users cannot use |
No, using only
Sorry, I did not word this clearly. What I meant is that in addition to |
router.go
Outdated
@@ -660,7 +668,7 @@ func (r *Router) Find(method, path string, c Context) { | |||
// act similarly to any node - consider all remaining search as match | |||
i = l | |||
} else { | |||
for ; i < l && search[i] != '/' && search[i] != '-'; i++ { | |||
for ; i < l && search[i] != '/' && !(search[i] == '-' || search[i] == '.'); i++ { |
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.
@aldas This is the best I could come up with, after spending some time trying around some stuff. Turns out that the dependency on "-" or "." is removed from the "route adding" and instead it is now on the "route detection". But one place should definitely have it or else, it cannot distinguish the params.
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.
actually I might be wrong here. Let me go over this again
Edit done. This is resolved.
Hi @aldas , I am just following up on this PR to see if there are any further changes to be made. Thank you for your time! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2560 +/- ##
==========================================
+ Coverage 92.89% 92.90% +0.01%
==========================================
Files 39 39
Lines 4658 4668 +10
==========================================
+ Hits 4327 4337 +10
Misses 240 240
Partials 91 91 ☔ View full report in Codecov by Sentry. |
@aldas Thank you for triggering the code coverage action. Looking forward to further updates on this PR. |
@aldas |
Implements this feature (#2557)
Adds :from-:to route.
example /flights/:from-:to