MCPcopy
hub / github.com/dnote/dnote / Do

Function Do

pkg/cli/utils/diff/diff.go:36–45  ·  view source on GitHub ↗

Do computes line-by-line diff between two strings

(s1, s2 string)

Source from the content-addressed store, hash-verified

34
35// Do computes line-by-line diff between two strings
36func Do(s1, s2 string) (diffs []diffmatchpatch.Diff) {
37 dmp := diffmatchpatch.New()
38 dmp.DiffTimeout = time.Hour
39
40 s1Chars, s2Chars, arr := dmp.DiffLinesToRunes(s1, s2)
41 diffs = dmp.DiffMainRunes(s1Chars, s2Chars, false)
42 diffs = dmp.DiffCharsToLines(diffs, arr)
43
44 return diffs
45}

Callers 2

reportBodyConflictFunction · 0.92
TestDoFunction · 0.70

Calls 1

NewMethod · 0.80

Tested by 1

TestDoFunction · 0.56