MCPcopy Create free account
hub / github.com/sergi/go-diff / DiffMain

Method DiffMain

diffmatchpatch/diff.go:84–86  ·  view source on GitHub ↗

DiffMain finds the differences between two texts. If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.

(text1, text2 string, checklines bool)

Source from the content-addressed store, hash-verified

82// DiffMain finds the differences between two texts.
83// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.
84func (dmp *DiffMatchPatch) DiffMain(text1, text2 string, checklines bool) []Diff {
85 return dmp.DiffMainRunes([]rune(text1), []rune(text2), checklines)
86}
87
88// DiffMainRunes finds the differences between two rune sequences.
89// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character.

Callers 11

PatchMakeMethod · 0.95
PatchApplyMethod · 0.95
TestDiffMainFunction · 0.80
TestDiffMainWithTimeoutFunction · 0.80
TestDiffPartialLineIndexFunction · 0.80
BenchmarkDiffMainFunction · 0.80
BenchmarkDiffMainLargeFunction · 0.80

Calls 1

DiffMainRunesMethod · 0.95

Tested by 9

TestDiffMainFunction · 0.64
TestDiffMainWithTimeoutFunction · 0.64
TestDiffPartialLineIndexFunction · 0.64
BenchmarkDiffMainFunction · 0.64
BenchmarkDiffMainLargeFunction · 0.64