MCPcopy
hub / github.com/expr-lang/expr / SplitLines

Function SplitLines

internal/difflib/difflib.go:771–775  ·  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

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

Callers 9

diffFunction · 0.92
TestOmitFilenamesFunction · 0.85
TestSplitLinesFunction · 0.85
benchmarkSplitLinesFunction · 0.85

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…