Ensure diff-match-patch works on array values of arrays
This commit is contained in:
parent
aa623a3985
commit
fd0abd2d8e
1 changed files with 1 additions and 7 deletions
|
@ -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...)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue