-
-
Notifications
You must be signed in to change notification settings - Fork 271
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 with boolean type (bool) #24
Comments
This is the expected behavior. As stated in README:
The zero value of a boolean field is false. It isn't possible to avoid it even with a pointer because Merge follows the pointers too. So, when it finds a pointer to bool with false value, it will overwrite with a true value if src matching field is true. If you have any doubt, don't hesitate to ask me. |
Thank you. |
For those of you who need it, @Pothulapati built a fork that solves this here. |
@darccio does this mean it is not possible to merge booleans at all using this tool then? If we cannot rely on it respecting a legitimate value of false? Or do you have a recommendation for how to get around this? It would be unfortunate if so as it would make it unusable for anyone with boolean values in their yaml, and otherwise the tool is brilliant. :( |
i think that for bool case we need to add additional logic |
Do you mean in the mergo repo or where it is being called? |
in mergo repo, but i dont know how to detect false vs not set =) |
Here is 3 ways to handle merge boolean the way we would like:
|
If struct has a boolean fields, merge result is prefer true value, but this is not correct.
Example:
The text was updated successfully, but these errors were encountered: