Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
contrib/net/http: support for path params from go 1.22 proposal #3079
contrib/net/http: support for path params from go 1.22 proposal #3079
Changes from 4 commits
9727b94
606c2aa
24781c0
dad28de
28de7ce
97d0f32
1e1915f
697c5c0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
nit: I had to dig into the implementation and tests to understand what this function returns (since the type
[]string
doesn't give much information). I think it would be nice if this was added to the doc string for future readers to quickly understand what this function does.Adding something at the end like:
Given a pattern like
"GET /foo/{bar}/{baz}"
, it returns[]string{"bar", "baz"}
Also having 2 functions
getPatternNames
andpatternNames
with almost the same function signature doesn't help much (the difference is the first one uses the cache first). WDYT about renaming this one toparsePattern
orparsePatternNames
? (ideally I think it should beparsePattern
, because if we want to parse other stuff from it in the future we would likely want to do it only once).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.
Applied all your comments (I believe) 👍