Documentation ¶
Overview ¶
Package patience implements the Patience Diff algorithm.
Package patience implements the Patience Diff algorithm.
Package patience implements the Patience Diff algorithm.
Index ¶
- func DiffText(diffs []DiffLine) string
- func DiffTextA(diffs []DiffLine) string
- func DiffTextB(diffs []DiffLine) string
- func LCS(a, b []string) [][2]int
- func UnifiedDiffText(diffs []DiffLine) string
- func UnifiedDiffTextWithOptions(diffs []DiffLine, opts UnifiedDiffOptions) string
- type DiffLine
- type DiffType
- type Hunk
- type UnifiedDiffOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffText ¶
DiffText returns the source and destination texts (all equalities, insertions and deletions).
func DiffTextB ¶ added in v0.2.0
DiffTextB returns the destination text (all equalities and insertions).
func LCS ¶
LCS computes the longest common subsequence of two string slices and returns the index pairs of the LCS.
func UnifiedDiffText ¶ added in v0.3.0
UnifiedDiffText returns the diff text in unidiff format with a context of 3 lines.
func UnifiedDiffTextWithOptions ¶ added in v0.3.0
func UnifiedDiffTextWithOptions(diffs []DiffLine, opts UnifiedDiffOptions) string
UnifiedDiffTextWithOptions returns the diff text in unidiff format.
Types ¶
type UnifiedDiffOptions ¶ added in v0.3.0
type UnifiedDiffOptions struct { // Precontext is the number of lines of context before each change in a hunk. Precontext int // Postcontext is the number of lines of context after each change in a hunk. Postcontext int // SrcHeader is the header for the source file. SrcHeader string // DstHeader is the header for the destination file. DstHeader string }
UnifiedDiffOptions represents the options for UnifiedDiffTextWithOptions.