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

Function GetContextDiffString

texteditor/difflib/difflib.go:1033–1037  ·  view source on GitHub ↗

GetContextDiffString is like WriteContextDiff but returns the diff as a string.

(diff LineDiffParams)

Source from the content-addressed store, hash-verified

1031
1032// GetContextDiffString is like WriteContextDiff but returns the diff as a string.
1033func GetContextDiffString(diff LineDiffParams) (string, error) {
1034 w := &bytes.Buffer{}
1035 err := WriteContextDiff(w, diff)
1036 return w.String(), err
1037}
1038
1039// SplitLines splits a string on "\n" while preserving them. The output can be used
1040// as input for LineDiffParams.

Calls 2

StringMethod · 0.95
WriteContextDiffFunction · 0.70