MCPcopy Create free account
hub / github.com/cogentcore/core / GetContextDiffString

Function GetContextDiffString

texteditor/difflib/bytes/bytes.go:1114–1118  ·  view source on GitHub ↗

GetContextDiffString Like WriteContextDiff but returns the diff a []byte.

(diff ContextDiff)

Source from the content-addressed store, hash-verified

1112
1113// GetContextDiffString Like WriteContextDiff but returns the diff a []byte.
1114func GetContextDiffString(diff ContextDiff) ([]byte, error) {
1115 w := &bytes.Buffer{}
1116 err := WriteContextDiff(w, diff)
1117 return w.Bytes(), err
1118}
1119
1120// SplitLines splits a []byte on "\n" while preserving them. The output can be used
1121// as input for UnifiedDiff and ContextDiff structures.

Calls 2

WriteContextDiffFunction · 0.70
BytesMethod · 0.45