You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Test struct {
ID int64 `diff:"id,identifier"`
Bool bool `diff:"bool"`
Test string `diff:"test"`
}
a := []Test{{ID: 1, Bool: true, Test: "Bool set to true"}}
b := []Test{{ID: 2, Bool: false, Test: "Bool set to false"}}
changelog, err := diff.Diff(a, b)
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("%+v\n", changelog)
Gives:
{Type:create Path:[2 id] From:<nil> To:2 parent:<nil>} {Type:create Path:[2 test] From:<nil> To:Bool set to false parent:<nil>}]
Field Bool is missing from create. Should also have: