Open
Description
Let us consider this code
import (
"fmt"
"github.com/herkyl/patchwerk"
)
func main() {
a := `{"L1": ["A", "B","C"]}`
b := `{"L1": ["C", "A","B"]}`
patch, err := patchwerk.DiffBytes([]byte(a), []byte(b))
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(patch))
}
Output:
[{"op":"add","path":"/L1/0","value":"C"}]'
But the actual output of the patch should be
[{remove /L1/2 } {add /L1/0 C}]
Where C at index 2 is removed and C is added at index 0
Metadata
Metadata
Assignees
Labels
No labels