MCPcopy Create free account
hub / github.com/pmezard/go-difflib / SplitLines

Function SplitLines

difflib/difflib.go:768–772  ·  view source on GitHub ↗

Split a string on "\n" while preserving them. The output can be used as input for UnifiedDiff and ContextDiff structures.

(s string)

Source from the content-addressed store, hash-verified

766// Split a string on "\n" while preserving them. The output can be used
767// as input for UnifiedDiff and ContextDiff structures.
768func SplitLines(s string) []string {
769 lines := strings.SplitAfter(s, "\n")
770 lines[len(lines)-1] += "\n"
771 return lines
772}

Callers 8

TestOmitFilenamesFunction · 0.85
TestSplitLinesFunction · 0.85
benchmarkSplitLinesFunction · 0.85

Calls

no outgoing calls

Tested by 8

TestOmitFilenamesFunction · 0.68
TestSplitLinesFunction · 0.68
benchmarkSplitLinesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…