We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code panics when using PatchApply
PatchApply
func main() { dmp := diffmatchpatch.New() patches, _ := dmp.PatchFromText("@@ -1,2 +1,3 @@\n %E2%98%9E \n+r\n") fmt.Println(dmp.PatchToText(patches)) s, _ := dmp.PatchApply(patches, "β π’π₯πππ₯ ") fmt.Println(fmt.Sprintf("%q", s)) }
panic: runtime error: slice bounds out of range [:35] with length 33 goroutine 1 [running]: github.com/sergi/go-diff/diffmatchpatch.(*DiffMatchPatch).PatchApply(0x14000109ef8, {0x14000078200?, 0x1, 0x1?}, {0x102d6650a, 0x19}) /Users/michael/go/pkg/mod/github.com/sergi/[email protected]/diffmatchpatch/patch.go:306 +0x998 main.main() /Users/michael/code/playground/scratch/main.go:14 +0xf0 exit status 2
It looks like its finding the wrong start location here - https://github.com/sergi/go-diff/blob/master/diffmatchpatch/patch.go#L265 E.g: this prints 25...
func main() { dmp := diffmatchpatch.New() fmt.Println(dmp.MatchMain("\x01\x02\x03\x04β π’π₯πππ₯ \x01\x02\x03\x04", "β \x01\x02\x03\x04", 4)) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following code panics when using
PatchApply
It looks like its finding the wrong start location here - https://github.com/sergi/go-diff/blob/master/diffmatchpatch/patch.go#L265
E.g: this prints 25...
The text was updated successfully, but these errors were encountered: