Skip to content
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

Add strict override #112

Merged
merged 2 commits into from
Apr 15, 2019
Merged

Conversation

silvin-lubecki
Copy link
Contributor

Fixing #111

Add a new option WithTypeCheck, which ensures that slice types are the same while overriding one by another one.
This was the case if used WithAppendSlice and WithOverride together, before commit 54bb0a6.
Now to get the same result, one should use WithOverride, WithTypeCheck in conjunction.

Also Fix and rename un-appropriate test, as merging directly 2 slices is not supported.

…ot supported.

Now this "feature" is explicit demonstrated in this test.

Signed-off-by: Silvin Lubecki <[email protected]>
…e same while overriding one by another one.

This was the case if used WithAppendSlice and WithOverride together, before commit 54bb0a6.
Now to get the same result, one should use WithOverride, WithTypeCheck in conjunction.

Signed-off-by: Silvin Lubecki <[email protected]>
@silvin-lubecki
Copy link
Contributor Author

@vdemeester PTAL 🙏

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯

@vdemeester vdemeester merged commit 5ef87b4 into darccio:master Apr 15, 2019
@silvin-lubecki silvin-lubecki deleted the add-strict-override branch April 15, 2019 13:35
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Oct 6, 2019
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]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Oct 7, 2019
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
burnMyDread pushed a commit to burnMyDread/moby that referenced this pull request Oct 21, 2019
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]>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 23, 2019
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]>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 23, 2019
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]>
zappy-shu pushed a commit to zappy-shu/cli that referenced this pull request Jan 21, 2020
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]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jan 24, 2020
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
eiffel-fl pushed a commit to eiffel-fl/cli that referenced this pull request Jul 28, 2020
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants