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
mergo.Merge
When merging maps with nil values current version of mergo skips them
mergo
nested := make(map[string]interface{}) e := mergo.Merge(&nested, map[string]interface{}{"x": nil}) if e == nil { fmt.Println(nested) }
map[]
New version of mergo allows us to change that behavior and avoid losing key-value pairs
nested := make(map[string]interface{}) e := mergo.Merge(&nested, map[string]interface{}{"x": nil}, func(c *mergo.Config) {c.Overwrite = true}) if e == nil { fmt.Println(nested) }
map[x:<nil>]
The text was updated successfully, but these errors were encountered:
Fixes mergo.Merge skips maps with nil values in it nqd#9
4c52e05
6b8e554
Merge pull request #10 from davitovmasyan/master
f7bbbfb
Fixes mergo.Merge skips maps with nil values in it #9
No branches or pull requests
When merging maps with nil values current version of
mergo
skips themNew version of
mergo
allows us to change that behavior and avoid losing key-value pairsThe text was updated successfully, but these errors were encountered: