yudai / gojsondiff

Go JSON Diff
Other
536 stars 79 forks source link

array diff "panic: runtime error: index out of range" #4

Closed yanyan300300 closed 8 years ago

yanyan300300 commented 8 years ago

➜ gojsondiff git:(master) ✗ cat a.json && cat b.json { "arr":[ "item0", "item1" ] } { "arr":[ "item0", "item2", "item3" ] }

➜ jd git:(master) ✗ go install && jd -f delta ../a.json ../b.json panic: runtime error: index out of range

Looks like typo here: https://github.com/yudai/gojsondiff/blob/master/gojsondiff.go#L364

shatrugna commented 8 years ago

Came across this issue. This patch fixes it. Thanks @yanyan300300. Can we pull this in @yudai?

yudai commented 8 years ago

Merged! thanks!