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

Function GetUnifiedDiffString

texteditor/difflib/bytes/bytes.go:986–990  ·  view source on GitHub ↗

GetUnifiedDiffString is like WriteUnifiedDiff but returns the diff a []byte.

(diff UnifiedDiff)

Source from the content-addressed store, hash-verified

984
985// GetUnifiedDiffString is like WriteUnifiedDiff but returns the diff a []byte.
986func GetUnifiedDiffString(diff UnifiedDiff) ([]byte, error) {
987 w := &bytes.Buffer{}
988 err := WriteUnifiedDiff(w, diff)
989 return w.Bytes(), err
990}
991
992// Convert range to the "ed" format.
993func formatRangeContext(start, stop int) []byte {

Calls 2

WriteUnifiedDiffFunction · 0.70
BytesMethod · 0.45