Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diff ¶
type Diff struct {
// contains filtered or unexported fields
}
func (*Diff) GetConflictResolutionTemplate ¶
GetConflictResolutionTemplate returns a single content with differences formatted in a manner similar to how merge conflicts are formatted by Git. Differences will be preceded by `<<<<<<< Deleted` followed by any lines present in `a` but not `b`, followed by `=======`, followed by any lines present in `b` but not `a`, followed by `>>>>>>> Added`. The lines in those blocks are not prefixed or otherwise altered. Any equal lines are included as is. Returns an empty string if there are no differences.
func (*Diff) GetUnifiedDiff ¶
GetUnifiedDiff returns the entire diff as a single string. Returns an empty string if there are no differences.
func (*Diff) GetUnifiedDiffConflictIndices ¶
GetUnifiedDiffConflictIndices returns the indices of the lines of the diff returned by either GetUnifiedDiffLines or GetUnifiedDiff. Indices are zero-based. Returns nil if there were zero differences. Returns at least one index otherwise.
func (*Diff) GetUnifiedDiffLines ¶
GetUnifiedDiffLines returns the lines of the diff. The lines are not terminated with \n. Returns nil if there were zero differences.
func (*Diff) IsDifferent ¶
IsDifferent returns true if there were any differences between a and b.