-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
added WithOverrideEmptySlice config flag #125
Conversation
It work. Please see. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rusdevops thanks for the PR. Can you add a test case for it ?
merge.go
Outdated
TypeCheck bool | ||
Transformers Transformers | ||
overwriteWithEmptyValue bool | ||
OverwriteSliceWithEmptyValue bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be un-exported (as we are using WithOverrideEmptySlice
), same as overwriteWithEmptyValue
is not exported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
added |
Please create a release after the merge 👍 |
@vdemeester, can you review PR ? please 😄 |
@imdario please see PR if you can |
This should resolve an issue we are seeing too. We have some state that looks like
where we want an empty array of strings in the src to overwrite the destination path and remove string I couldn't find a way to set @imdario or @rusdevops any insight on a way I could accomplish this or is this PR needed to make what we need happen? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🐯
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 9bd1b1a8eca97a2403bc7a2ed9a52427d8c27078 Component: engine
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]> Signed-off-by: zach <[email protected]>
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]>
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]> Upstream-commit: 6cf7970cd397a77155aec077bd27755bc033b6f4 Component: cli
full diff: darccio/mergo@v0.3.7...v0.3.8 includes: - darccio/mergo#112 Add strict override - fixes darccio/mergo#111 WithOverride should be able to check types - darccio/mergo#106 Fix merging of interface types with concrete values - darccio/mergo#120 should not overwrite pointers directly, instead check embedded values - fixes darccio/mergo#114 Embedded struct of pointer types will overwrite the whole destination struct - darccio/mergo#125 added WithOverrideEmptySlice config flag Signed-off-by: Sebastiaan van Stijn <[email protected]>
I want to overwrite the null slice with an empty slice