Versions in this module Expand all Collapse all v0 v0.14.0 Nov 29, 2024 v0.13.0 Nov 22, 2024 Changes in this version + const DefaultContextLines + func Apply(src string, edits []Edit) (string, error) + func ApplyBytes(src []byte, edits []Edit) ([]byte, error) + func SortEdits(edits []Edit) + func ToUnified(oldLabel, newLabel, content string, edits []Edit, contextLines int) (string, error) + func Unified(oldLabel, newLabel, old, new string) string + type Edit struct + End int + New string + Start int + func Bytes(before, after []byte) []Edit + func Strings(before, after string) []Edit + func (e Edit) String() string + type OpKind int + const Delete + const Equal + const Insert + func (k OpKind) String() string + type UnifiedDiff = unified + func ToUnifiedDiff(fromName, toName string, content string, edits []Edit, contextLines int) (UnifiedDiff, error)