Package list golang-github-imdario-mergo / f8cb972
Imported Upstream version 0.2.0 Tim Potter 5 years ago
2 changed file(s) with 2 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
1717
1818 ### Important note
1919
20 Mergo is intended to assign **only** zero value fields on destination with source value. Since April 6th it works like this. Before it didn't work properly, causing some random overwrites. After some issues and PRs I found it didn't merge as I designed it. Thanks to [imdario/mergo#8](https://github.com/imdario/mergo/pull/8) overwriting functions were added and the wrong behavior was clearly detected.
20 Mergo is intended to merge **only** zero value fields on destination. Since April 6th it works like this. Before it didn't work properly, causing some random overwrites. After some issues and PRs I found it didn't merge as I designed it. Thanks to [imdario/mergo#8](https://github.com/imdario/mergo/pull/8) overwriting functions were added and the wrong behavior was clearly detected.
2121
2222 If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0).
2323
2424 ### Mergo in the wild
2525
26 - [imdario/zas](https://github.com/imdario/zas)
2726 - [GoogleCloudPlatform/kubernetes](https://github.com/GoogleCloudPlatform/kubernetes)
2827 - [soniah/dnsmadeeasy](https://github.com/soniah/dnsmadeeasy)
2928 - [EagerIO/Stout](https://github.com/EagerIO/Stout)
3332 - [casualjim/exeggutor](https://github.com/casualjim/exeggutor)
3433 - [divshot/gitling](https://github.com/divshot/gitling)
3534 - [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl)
36 - [andrerocker/deploy42](https://github.com/andrerocker/deploy42)
37 - [elwinar/rambler](https://github.com/elwinar/rambler)
38 - [tmaiaroto/gopartman](https://github.com/tmaiaroto/gopartman)
39 - [jfbus/impressionist](https://github.com/jfbus/impressionist)
40 - [Jmeyering/zealot](https://github.com/Jmeyering/zealot)
41 - [godep-migrator/rigger-host](https://github.com/godep-migrator/rigger-host)
42 - [Dronevery/MultiwaySwitch-Go](https://github.com/Dronevery/MultiwaySwitch-Go)
43 - [thoas/picfit](https://github.com/thoas/picfit)
44 - [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server)
45 - [jnuthong/item_search](https://github.com/jnuthong/item_search)
4635
4736 ## Installation
4837
10089
10190 fmt.Println(dest)
10291 // Will print
103 // {two 2}
92 // {one 2}
10493 }
10594 ```
10695
5454 }
5555 }
5656 if !isEmptyValue(srcElement) && (overwrite || (!dstElement.IsValid() || isEmptyValue(dst))) {
57 if dst.IsNil() {
58 dst.Set(reflect.MakeMap(dst.Type()))
59 }
6057 dst.SetMapIndex(key, srcElement)
6158 }
6259 }