[NEW] Compare pointer
herryg91 opened this issue · 0 comments
herryg91 commented
This code below will show error message "panic: Unsupported comparable values". I think it will be very usefull if this library can support comparing struct with pointer, since reflect.DeepEqual doesn't support it very well.
oldPerson := &person{
Name: "Gopher",
Age: 10,
Weight: 50.0,
IsMarried: false,
Hobbies: []string{"Coding"},
Numbers: []int{0, 1, 2},
AdditionalInfo: "I love Golang",
}
newPerson := &person{
Name: "Gopher",
Age: 10,
Weight: 60.0,
IsMarried: false,
Hobbies: []string{"Hacking"},
Numbers: []int{1, 2, 3},
AdditionalInfo: "I love Golang so much",
}
diffs, err := libra.Compare(nil, oldPerson, newPerson)
if err != nil {
panic(err)
}