Open
Description
type Foo struct {
A string
B int64
C bool
D string
}
src := Foo{
A: "a",
B: 52,
C: false,
D: "2012-02-02",
}
dest := Foo{
A: "b",
B: 12,
C: true,
D: "2012-02-03",
}
mergo.Merge(&dest, src, mergo.WithOverride)
fmt.Println(src)
fmt.Println(dest)
fmt.Printf("%+v", dest)
got
{a 52 false 2012-02-02}
{a 52 true 2012-02-02}
{A:a B:52 C:true D:2012-02-02}
expected
{a 52 false 2012-02-02}
{a 52 false 2012-02-02}
{A:a B:52 C:false D:2012-02-02}
type Foo struct {
A string
B int64
C bool
D string
}
src := Foo{
A: "a",
B: 52,
C: true,
D: "2012-02-02",
}
dest := Foo{
A: "b",
B: 12,
C: false,
D: "2012-02-03",
}
mergo.Merge(&dest, src, mergo.WithOverride)
fmt.Println(src)
fmt.Println(dest)
fmt.Printf("%+v", dest)
got
{a 52 true 2012-02-02}
{a 52 true 2012-02-02}
{A:a B:52 C:true D:2012-02-02}
expected
{a 52 true 2012-02-02}
{a 52 true 2012-02-02}
{A:a B:52 C:true D:2012-02-02}
As you can see overriding true with false
fails, however overriding false with true
works
Upvote & Fund
- We're using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
Metadata
Metadata
Assignees
Labels
No labels