type CorrelatedObject … func NewCorrelatedObject(new, old interface{ … } // If OldValue or Value is not a list, or the index is out of bounds of the // Value list, returns nil // If oldValue is a list, this considers the x-list-type to decide how to // correlate old values: // // If listType is map, creates a map representation of the list using the designated // map-keys, caches it for future calls, and returns the map value, or nil if // the correlated key is not in the old map // // Otherwise, if the list type is not correlatable this funcion returns nil. func (r *CorrelatedObject) correlateOldValueForChildAtNewIndex(index int) interface{ … } // CachedDeepEqual is equivalent to reflect.DeepEqual, but caches the // results in the tree of ratchetInvocationScratch objects on the way: // // For objects and arrays, this function will make a best effort to make // use of past DeepEqual checks performed by this Node's children, if available. // // If a lazy computation could not be found for all children possibly due // to validation logic short circuiting and skipping the children, then // this function simply defers to reflect.DeepEqual. func (r *CorrelatedObject) CachedDeepEqual() (res bool) { … } // Key returns the child of the receiver with the given name. // Returns nil if the given name is does not exist in the new object, or its // value is not correlatable to an old value. // If receiver is nil or if the new value is not an object/map, returns nil. func (r *CorrelatedObject) Key(field string) *CorrelatedObject { … } // Index returns the child of the receiver at the given index. // Returns nil if the given index is out of bounds, or its value is not // correlatable to an old value. // If receiver is nil or if the new value is not an array, returns nil. func (r *CorrelatedObject) Index(i int) *CorrelatedObject { … }