ObjectReflectDiff has an incorrect array index comparison

Is comparing the wrong field for bounds.
pull/6/head
Clayton Coleman 2016-07-03 20:09:14 -04:00
parent feea382960
commit ee56123634
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
1 changed files with 2 additions and 2 deletions

View File

@ -177,10 +177,10 @@ func objectReflectDiff(path *field.Path, a, b reflect.Value) []diff {
}
}
var diffs []diff
for i := l; l < lA; i++ {
for i := l; i < lA; i++ {
diffs = append(diffs, diff{path: path.Index(i), a: a.Index(i), b: nil})
}
for i := l; l < lB; i++ {
for i := l; i < lB; i++ {
diffs = append(diffs, diff{path: path.Index(i), a: nil, b: b.Index(i)})
}
return diffs