Documentation ¶
Overview ¶
Package godiff provides primitives to return and/or show differences between two files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AdditionSign is the prefix that is added before an added line in the diff. // By default, it is a plus sign. AdditionSign = "+" // RemovalSign is the prefix that is added before a removed line in the diff. // By default, it is a minus sign. RemovalSign = "-" // UnchangedSign is the prefix that is added before an unchanged line in the diff. // By default, it is a tilde sign. UnchangedSign = "~" // ShowUnchangedSign indicates if we want to show the UnchangedSign in front of // unchanged lines or not. // By default, it is set to false. ShowUnchangedSign = false // SignLineSeparator is what's between the Addition or Removal sign and the // text. By default, it is a single whitespace. SignLineSeparator = " " )
Functions ¶
Types ¶
type File ¶
type File []byte
File represents a slice of bytes that will be diffed to another File.
func NewFileFromBytes ¶
NewFileFromBytes converts a slice of bytes into a File.
func NewFileFromString ¶
NewFileFromString converts a string into a File.
func (File) IsDifferentFrom ¶
IsDifferentFrom returns true if f2 is different from f1 false otherwise.
func (File) IsIdenticalTo ¶
IsIdenticalTo returns true is f2 is identical to f1, false otherwise.
Click to show internal directories.
Click to hide internal directories.