Documentation
¶
Overview ¶
Package difflib provides a unified diff for sequences of strings.
It exposes the unified diff formatter used internally by github.com/go-openapi/testify/v2.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUnifiedDiffString ¶
func GetUnifiedDiffString(diff UnifiedDiff) (string, error)
GetUnifiedDiffString is like WriteUnifiedDiff but returns the diff as a string instead of writing to an io.Writer.
func SplitLines ¶
SplitLines splits a string on "\n" while preserving them. The output can be used as input for the UnifiedDiff structure.
func WriteUnifiedDiff ¶
func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error
WriteUnifiedDiff writes the comparison between two sequences of lines.
It generates the delta as a unified diff.
Types ¶
type Formatter ¶
Formatter is a formatting function like fmt.Printf.
type FormatterBuilder ¶
type FormatterBuilder = idifflib.FormatterBuilder
FormatterBuilder is a function that builds a Formatter given a buffered bufio.Writer.
type PrinterBuilder ¶
type PrinterBuilder = idifflib.PrinterBuilder
PrinterBuilder is a function that builds a Printer given a buffered bufio.Writer.
type UnifiedDiff ¶
type UnifiedDiff = idifflib.UnifiedDiff
UnifiedDiff holds the unified diff parameters.