-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
MergeWithOverwrite behavior on struct field inside a map #14
Comments
As far as I am aware it is not possible to differentiate between a string value not having been set or being empty "". Both "" and nil will result in the same value. If Is there any solution? => Kind of, if the value is a pointer to a string, in such cases the code will receive nil. |
Pleas, check again with the latest version, @accerqueira. |
This will be handled in the new cleanroom implementation. |
Hi,
I would expect that fields from a struct on a map would only be overwritten by MergeWithOverwrite if the src struct field was not empty valued, but according to the following test, it seems to be overwriting anyway on map to struct and map to struct pointer.
go test -v mergo_test.go
gives me the following outputIt seems to work the way I expected for struct and struct of struct though.
The text was updated successfully, but these errors were encountered: