Ensure diff-match-patch works on array values of arrays

This commit is contained in:
Tobie Morgan Hitchcock 2021-01-21 06:37:23 +00:00
parent aa623a3985
commit fd0abd2d8e

View file

@ -748,13 +748,7 @@ func (d *Doc) Append(value interface{}, path ...string) (*Doc, error) {
return &Doc{data: nil}, fmt.Errorf("Not an array") return &Doc{data: nil}, fmt.Errorf("Not an array")
} }
if values, ok := value.([]interface{}); ok {
for _, value := range values {
a = append(a, value) a = append(a, value)
}
} else {
a = append(a, value)
}
return d.Set(a, path...) return d.Set(a, path...)