-
Notifications
You must be signed in to change notification settings - Fork 17.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
net/url: add Values.Has(key) #45100
Comments
Can this be reduced to?
So instead of writing |
Yep, that is more concise, I agree. |
It seems like the usual Go word is Has for this (HasPrefix, HasSuffix, types.TypeAndValue.HasOk, etc). |
This proposal has been added to the active column of the proposals project |
There are 5 thumbs down on the original, but it does seem like this is the one operation that we haven't put into the Values API, and we might as well. Does anyone object to adding Values.Has? If so, why? |
@rsc I suppose it's due to naming, |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Adds a method within Values of detecting whether a query parameter without a value is set. Fixes golang#45100
Change https://golang.org/cl/314850 mentions this issue: |
There is currently no inbuilt method within Values of detecting whether a query parameter without a value is set (e.g.
http://example.com/?queryname
).I propose adding the following method to determine whether a specific key is set:
This would also work for query parameters with values.
The text was updated successfully, but these errors were encountered: