Split a string on "\n" while preserving them. The output can be used as input for UnifiedDiff and ContextDiff structures.
(s string)
| 769 | // Split a string on "\n" while preserving them. The output can be used |
| 770 | // as input for UnifiedDiff and ContextDiff structures. |
| 771 | func SplitLines(s string) []string { |
| 772 | lines := strings.SplitAfter(s, "\n") |
| 773 | lines[len(lines)-1] += "\n" |
| 774 | return lines |
| 775 | } |
no outgoing calls
searching dependent graphs…