mergo
mergo copied to clipboard
Add WithNoOverrideEmptyStructValues
Add option to not overwrite empty fields in destination structs if the structs are not empty.
Hello, @cwarden! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.
I'm not positive that this needs a new option. If it does, perhaps it should be generalized to more than structs or to depths other than zero.
Please take a look at the tests. Thoughts?
@cwarden Sorry it took so long. The tests look fine, but I'm not sure if this PR can introduce unknown side effects. It looks you have been using your fork for a year. Did you find anything wrong during this time?
Hi @imdario. This change has been working well for me in https://github.com/ForceCLI/force-md.
This will be considered as part of v2.