Like WriteUnifiedDiff but returns the diff a string.
(diff UnifiedDiff)
| 633 | |
| 634 | // Like WriteUnifiedDiff but returns the diff a string. |
| 635 | func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { |
| 636 | w := &bytes.Buffer{} |
| 637 | err := WriteUnifiedDiff(w, diff) |
| 638 | return string(w.Bytes()), err |
| 639 | } |
| 640 | |
| 641 | // Convert range to the "ed" format. |
| 642 | func formatRangeContext(start, stop int) string { |
searching dependent graphs…