We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When trying to merge two maps, mergo does not respectWithOverwriteWithEmptyValue.
WithOverwriteWithEmptyValue
Eg:
destination := map[string]string{"a": "valueOfA"} source := map[string]string{"b": "valueOfB", "c": "valueOfC"} mergo.Merge(&destination, &source, mergo.WithOverwriteWithEmptyValue)
Current output: map[a:valueOfA b:valueOfB c:valueOfC]
map[a:valueOfA b:valueOfB c:valueOfC]
Expected output: map[b:valueOfB c:valueOfC] Since "a" should be discarded with provided WithOverwriteWithEmptyValue option.
map[b:valueOfB c:valueOfC]
Playground: https://go.dev/play/p/kR8K-G7sPPt
The text was updated successfully, but these errors were encountered:
fix: Respect overwriteWithEmptySrc when merging maps
69d18dc
Fixes darccio/issues/230.
81666e0
Successfully merging a pull request may close this issue.
When trying to merge two maps, mergo does not respect
WithOverwriteWithEmptyValue
.Eg:
Current output:
map[a:valueOfA b:valueOfB c:valueOfC]
Expected output:
map[b:valueOfB c:valueOfC]
Since "a" should be discarded with provided
WithOverwriteWithEmptyValue
option.Playground: https://go.dev/play/p/kR8K-G7sPPt
The text was updated successfully, but these errors were encountered: