Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffAsStringOptions ¶
func DiffAsStringOptions() *diffItemsAsStringOptions
Types ¶
type DiffItem ¶
type DiffItem struct { Line string From DiffSource }
type DiffItems ¶
type DiffItems []DiffItem
DiffItems is array of diff items, that has useful `AsString` method which can give you a readable format. You can use default String method if you want default settings
func Diff ¶
Diff takes two array of strings of arbitrary size and returns array of DiffItem. Each diff item repesents a Line and it's purpose -- added from left string array, added from right string, or equal in both left and right string arrays.
func LineDiff ¶
LineDiff takes two strings and calculates diff in terms of lines that came from a or from b. It calculates DiffItems, which is array of []DiffItem -- an array of minimal length that describes what lines came from a, what lines came from b, and what lines are common. Further DiffItems can be converted to string with AsString method.
type DiffSource ¶
type DiffSource string
const ( DiffSourceBoth DiffSource = "both" DiffSourceLeft DiffSource = "left" DiffSourceRight DiffSource = "right" )