mergo icon indicating copy to clipboard operation
mergo copied to clipboard

Mergo: merging Go structs and maps since 2013

Results 39 mergo issues
Sort by recently updated
recently updated
newest added

Here's an example ``` type Option struct { test bool } o := Option{} mergo.Merge(&o, &Option{test: true}) ``` In this example test will be false. WithOverride won't really work here,...

help wanted
hacktoberfest

Hi, We are trying to do a custom merge on slices in our project. For simplicity I have used `IntSlice`(a custom type of slice of ints) in this example. The...

help wanted
hacktoberfest

In some case, nil pointer merging should be skipped. This field could work with `WithOverwriteWithEmptyValue` to solve situation in https://github.com/imdario/mergo/issues/131, a false bool pointer will be merged and a nil...

> I will define some models, and I will also use protobuf. Sometimes their field types are different, so I want to customize the transformer according to the types of...

help wanted
hacktoberfest
v2

```go type TestStruct struct { ID string Deep map[string]interface{} } t0 := TestStruct{} t1 := TestStruct{ ID: "5", Deep: map[string]interface{}{"workers": map[string]interface{}{"num": 5}}, } mergo.Merge(&t0, t1) fmt.Printf("Address of t0.Deep['worker'] = %p\n",...

help wanted
hacktoberfest

The behavior of merging with override enabled on pointers does not seem to be respected the same way as other types. I have highlighted the behavior in this go playground:...

help wanted
hacktoberfest

Hiya, firstly, thank you for this project, of the bunch out there offering similar functionality this package is the only one I found that really does the job right and...

help wanted
hacktoberfest

As mentioned in the title, the `struct` in map value is overwritten completely. I don't whether it is expected behaviour from the implementor's perspective. But the behaviour surprises me. See....

help wanted
hacktoberfest

eg: Merge with WithOverride ``` package main import ( "fmt" "github.com/imdario/mergo" ) type Foo map[string]interface{} func main() { src := Foo{ "partners": []map[string]interface{}{ { "common": "common_field", "enabled": true, }, {...

help wanted
hacktoberfest
v2

See https://go.dev/play/p/wUmW7O4Fr5s. If "x" is overridden (which is what I would expect), I don't see why "y" isn't.

help wanted
hacktoberfest