Understand the Change struct format
masterWhen you call diff.Diff(from, to), the library returns a changelog containing Change objects. Each object describes a specific modification:
Type: The nature of the change (create,update, ordelete).Path: A slice of strings representing the traversal path (field names or array indices) to the changed value.From: The original value in thefromstructure.To: The new value detected in thetostructure.
type Change struct {
Type string // The type of change detected; can be one of create, update or delete
Path []string // The path of the detected change; will contain any field name or array index that was part of the traversal
From interface{} // The original value that was present in the "from" structure
To interface{} // The new value that was detected as a change in the "to" structure
}