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

allow overriding old, non-map, map element with map #226

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

ronaudinho
Copy link
Contributor

probably fixes #202. i know the title sounds confusing, feel free to change to make it sound better. most test cases are probably unnecessary and are already covered.

Comment on lines +45 to +63
{
name: "map override string",
dst: map[string]interface{}{
"x": 456,
"y": "foo",
},
src: map[string]interface{}{
"x": "123",
"y": map[string]interface{}{
"a": true,
},
},
want: map[string]interface{}{
"x": "123",
"y": map[string]interface{}{
"a": true,
},
},
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as per example mentioned in the issue, the rest of the cases actually already works without this change.

@darccio darccio merged commit dcef160 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.WithOverride on maps replaces old keys only for certain types
2 participants