MCPcopy Create free account
hub / github.com/sergi/go-diff / PatchToText

Method PatchToText

diffmatchpatch/patch.go:469–475  ·  view source on GitHub ↗

PatchToText takes a list of patches and returns a textual representation.

(patches []Patch)

Source from the content-addressed store, hash-verified

467
468// PatchToText takes a list of patches and returns a textual representation.
469func (dmp *DiffMatchPatch) PatchToText(patches []Patch) string {
470 var text bytes.Buffer
471 for _, aPatch := range patches {
472 _, _ = text.WriteString(aPatch.String())
473 }
474 return text.String()
475}
476
477// PatchFromText parses a textual representation of patches and returns a List of Patch objects.
478func (dmp *DiffMatchPatch) PatchFromText(textline string) ([]Patch, error) {

Callers 4

TestPatchToTextFunction · 0.80
TestPatchSplitMaxFunction · 0.80
TestPatchAddPaddingFunction · 0.80

Calls 1

StringMethod · 0.45

Tested by 4

TestPatchToTextFunction · 0.64
TestPatchSplitMaxFunction · 0.64
TestPatchAddPaddingFunction · 0.64