DiffLines computes the diff between two string arrays (one string per line), reporting a sequence of operations that would convert buffer a into buffer b. Each operation is either an 'r' (replace), 'd' (delete), 'i' (insert) or 'e' (equal). Everything is line-based (0, offset).
(astr, bstr []string)
| 81 | // Each operation is either an 'r' (replace), 'd' (delete), 'i' (insert) |
| 82 | // or 'e' (equal). Everything is line-based (0, offset). |
| 83 | func DiffLines(astr, bstr []string) Diffs { |
| 84 | m := difflib.NewMatcherWithJunk(astr, bstr, false, nil) // no junk |
| 85 | return m.GetOpCodes() |
| 86 | } |
| 87 | |
| 88 | // DiffLinesUnified computes the diff between two string arrays (one string per line), |
| 89 | // returning a unified diff with given amount of context (default of 3 will be |