Unexpected Behavior When Merging Structs Without Override #260
Unanswered
sourabh-khot65
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using mergo.Merge with override set to false, non-empty fields in the destination struct are being overwritten by values from the source struct. This behavior contradicts the expected functionality where only empty fields in the destination should be updated.
Expected Behavior:
Actual Behavior:
This behavior is unexpected, as mergo.Merge should only populate empty fields in dest when WithOverride is not used. Could you clarify if this is intended behavior or provide a solution? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions