Skip to content
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

fix: Respect overwriteWithEmptySrc when merging maps #231

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

rquitales
Copy link
Contributor

@rquitales rquitales commented Mar 8, 2023

Fixes #230.

Bug originally identified in pulumi/pulumi-kubernetes#2331.

Copy link

@lblackstone lblackstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on Ramon's team and independently reviewed this change. LGTM

@lblackstone
Copy link

I think this also fixes #185

@rquitales
Copy link
Contributor Author

@imdario Could you please take a look at your earliest convenience? Thanks!

@darccio
Copy link
Owner

darccio commented Mar 15, 2023

@rquitales The tests don't pass:

--- FAIL: TestIssue89MergeWithEmptyValue (0.00s)
    issue89_test.go:54: expected 3 in p1["A"], got <nil>
FAIL
FAIL    github.com/imdario/mergo        0.004s
FAIL

@rquitales
Copy link
Contributor Author

@imdario Thanks for checking! Must have missed running go test -v ./... before committing. Have updated the failing test case to respect overwriteWithEmptySrc as well. All tests should now be passing.

@darccio
Copy link
Owner

darccio commented Mar 15, 2023

@rquitales Usually I don't accept PRs that modify previously existing tests, as they are supposed to be the reflection of past decisions/fixed issues.

But I'm going to trust you, because I see that it seems to be an expected behaviour that I didn't anticipate.

@darccio darccio merged commit 68ed330 into darccio:master Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mergo is not overriding destination map key with empty value with WithOverwriteWithEmptyValue
3 participants