GetContextDiffString Like WriteContextDiff but returns the diff a []byte.
(diff ContextDiff)
| 1112 | |
| 1113 | // GetContextDiffString Like WriteContextDiff but returns the diff a []byte. |
| 1114 | func GetContextDiffString(diff ContextDiff) ([]byte, error) { |
| 1115 | w := &bytes.Buffer{} |
| 1116 | err := WriteContextDiff(w, diff) |
| 1117 | return w.Bytes(), err |
| 1118 | } |
| 1119 | |
| 1120 | // SplitLines splits a []byte on "\n" while preserving them. The output can be used |
| 1121 | // as input for UnifiedDiff and ContextDiff structures. |