-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
GetOk returning exists=false for zero values #4936
Comments
Hi @Carles-Figuerola - I agree this is a bit confusing. It's due to some history around We're going to solve this by introducing a proper concept for providers to check whether a given key is set in config or not, and #5694 is going to track that work. So I'll close this issue so we can consolidate our efforts there. Feel free to follow up if you have further questions on this! 👍 |
Yes, that's exactly it. Thank you very much! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When a boolean is set to false, the GetOk helper will unset the
exists
return value because it assumes a zero value is an unexpected return value.Will print
false, false
, whereas I would expect it to befalse, true
I would expect that values of the
int
orbool
type, would be set by the user to0
orfalse
as a valid value. Could this behaviour be changed?The text was updated successfully, but these errors were encountered: