Like WriteUnifiedDiff but returns the diff a string.
(diff UnifiedDiff)
| 641 | |
| 642 | // Like WriteUnifiedDiff but returns the diff a string. |
| 643 | func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { |
| 644 | w := &bytes.Buffer{} |
| 645 | err := WriteUnifiedDiff(w, diff) |
| 646 | return w.String(), err |
| 647 | } |
| 648 | |
| 649 | // Split a string on "\n" while preserving them. The output can be used |
| 650 | // as input for UnifiedDiff and ContextDiff structures. |