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

Feature : Override Nil on merge #123

Closed
VimalKumarS opened this issue Aug 27, 2019 · 7 comments
Closed

Feature : Override Nil on merge #123

VimalKumarS opened this issue Aug 27, 2019 · 7 comments

Comments

@VimalKumarS
Copy link

Request feature : override nil, if want to nullify dest with nil value

    dest:= make(map[string]interface{})
src :=make(map[string]interface{})

dest["col1"]=2
dest["col2"]=3
dest["col3"]=3
src["col1"]=nil
src["col2"]=4
src["col2"]=nil

mergo.Merge(&dest, src,mergo.WithOverride)

I tried to change code in order to set nil line#96

if srcElement.IsNil() {
			if (config.overwrite) {
				dst.SetMapIndex(key, srcElement)
				}
				continue
				}

thanks
Vimal

@github4jiawen
Copy link

#89 may help

@rusdevops
Copy link

rusdevops commented Dec 22, 2019

I was hoping that 128 PR resolve this issue, but no.

@darccio
Copy link
Owner

darccio commented May 17, 2020

This is fixed in master, it will be available in next release 0.3.10.

@darccio darccio closed this as completed May 17, 2020
darccio added a commit that referenced this issue May 17, 2020
@rusdevops
Copy link

rusdevops commented May 19, 2020

@imdario, thanks, we will be very grateful for the early release of the new release - 0.3.10.
we were happy to serve coffee ☕ from fast-ide

@loeffel-io
Copy link

Need this too

@darccio
Copy link
Owner

darccio commented Jul 16, 2020

@rusdevops Sorry, I wasn't able to do an early release. I'm working fixing 0.3.9 specific bugs and merging other PRs.

darccio added a commit that referenced this issue Jul 17, 2020
commit 64219f269280df8ad7c8abf48c3a33697154e70a
Author: Dario Castañé <d@rio.hn>
Date:   Sat Jul 18 00:11:30 2020 +0200

    Issue #123 reverted

commit 1c0f4c5e64026215964a7365cc2da1750bf44f31
Author: János Pásztor <janoszen@users.noreply.github.com>
Date:   Mon Jun 8 08:42:20 2020 +0200

    Added janoszen/containerssh as  a mergo user

commit 36e7eb818ccb22432f4c0824f820c5c832b70538
Author: Dario Castañé <d@rio.hn>
Date:   Sat Jul 18 00:09:18 2020 +0200

    Fatal* replaced by Error* functions

commit a3badb1749efbc887cf881cf78eba881c0864773
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 16:59:56 2020 +0200

    Improved semantics of tests for issue #129

commit e7166a5d1ccf985ad9077a4ce23edc0fae0d7378
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 16:52:27 2020 +0200

    Issue #129 closed

commit 4c6b27f7c7eacc5575f1eb454419258e8c92c2d1
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 16:40:14 2020 +0200

    Issue #89 closed

commit 293f485af2dce978b4fd27b65789b5e4a92df4fd
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 16:36:55 2020 +0200

    Improved name for the final condition to set

commit a4db553223c3a1ba8de4035e1110133ec3c5ae48
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 16:06:36 2020 +0200

    Issue #138 fixed

commit 8583b70567e0f59382ca76f0bbe999470e8982df
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 14:58:37 2020 +0200

    Issue #136 resolved

commit f34173f37dbe977477feb95cf3cba1cfb3919630
Author: Dario Castañé <d@rio.hn>
Date:   Fri Jul 17 23:50:34 2020 +0200

    Issue #131 fixed again

commit 1fdd4e8dbae7c1b8c88d550aab142f32bc3d0c86
Author: Dario Castañé <i@dario.im>
Date:   Sun May 17 14:47:55 2020 +0200

    Issue 131 fixed

commit 2fbb87d2f9fbdb47fdf6d2d4274ec8a05ca698c2
Author: Tariq Ibrahim <tariq181290@gmail.com>
Date:   Thu Apr 23 12:49:33 2020 -0700

    add release badge to track latest release of mergo

commit 815b47be4da2a8dcb87ab36544466b89c1c0e40d
Author: Eyal <eyalsoha@google.com>
Date:   Tue Apr 14 08:57:57 2020 -0400

    Fix typo transfomer -> transformer

commit 6ed75f818a997495ab9eb9d474f4bc13bad3e5bc
Author: Dario Castañé <dcastane@loyal.guru>
Date:   Fri Mar 27 08:34:25 2020 +0100

    README updated to last release v0.3..9

commit 9b0f1c7e5c418675c7f9d1ab588b8bf6b29ac1ff
Author: Dario Castañé <d@rio.hn>
Date:   Fri Jul 17 23:28:50 2020 +0200

    Improved semantics for mergeable fields

commit cf80c4cbd6102982dd91eb0ded30558692a3f43d
Author: Dario Castañé <d@rio.hn>
Date:   Fri Jul 17 23:18:59 2020 +0200

    Faulty test removed

commit 5a49eb5583bd3ebdae0afe011a66ae5365196918
Author: Dario Castañé <d@rio.hn>
Date:   Fri Jul 17 23:10:01 2020 +0200

    Working on CI fixes and v0.3.9 bugs

commit b75bbeef3b546d3fb916271538adc25bbde20f8d
Author: Dario Castañé <dcastane@loyal.guru>
Date:   Thu Mar 26 22:43:59 2020 +0100

    Dead code removed

commit c08f60a65adf317d234f1f5eb51572c30c9b87d0
Author: Dario Castañé <dcastane@loyal.guru>
Date:   Thu Mar 26 22:43:50 2020 +0100

    Destination pointer type check added to map

commit e5e7507289bba3e635e6a9df7671d58915ac0487
Author: Stefan Bourlon <s.bourlon@gmail.com>
Date:   Mon Feb 3 11:51:09 2020 -0800

    merge: test dst is a pointer

    Return an error instead of panicking if merge receives dst != pointer

commit b8a2f9bd2feb2110ee3cb550372cc4105ebcaa99
Author: Umair Idris <umair.m.idris@gmail.com>
Date:   Mon Jan 20 05:21:09 2020 -0500

    Fix lint (#135)

commit 3cebbeca61cb9226249551e9c8afc24bf64fe559
Author: komalsinha-g <59949151+komalsinha-g@users.noreply.github.com>
Date:   Fri Jan 17 14:36:55 2020 +0530

    Make "OverwriteWithEmptyValue" in config struct to be set by any method. (#133)

    Make "OverwriteWithEmptyValue" in config struct to be set by any method.

    this make the merge more customizable. In cases, where request toggles a boolean value and the the request message can change a "true" value to false we can pass the flag to merge accordingly, which is not possible otherwise.

commit f444b9dcd2f5e66f8572b474b465564ba4f54240
Author: Dario Castañé <i@dario.im>
Date:   Wed Jan 1 22:27:24 2020 +0100

    DeepSource support

commit a6318969156f71a80c41afd42104c53f239ff23a
Author: Dario Castañé <i@dario.im>
Date:   Wed Jan 1 22:25:43 2020 +0100

    Assert removed

commit 6c2f66f933a1741f448e437dea3cb491a7c979d8
Author: Peer Xu <pppeerxu@gmail.com>
Date:   Sat Oct 12 10:35:47 2019 +0800

    Fixed typo

commit 8993363a0c7c25aec36e0da04e82d4988d6cc96b
Author: Peer Xu <pppeerxu@gmail.com>
Date:   Sat Oct 12 10:26:25 2019 +0800

    added WithSliceDeepCopy config flag
@darccio
Copy link
Owner

darccio commented Jul 17, 2020

Reopening this issue as PR #105 introduced too many bugs, and this issue isn't fixed with the current state of master.

@darccio darccio reopened this Jul 17, 2020
darccio added a commit that referenced this issue Jul 17, 2020
@darccio darccio closed this as completed Jul 17, 2020
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

No branches or pull requests

5 participants