Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Differ ¶
type Differ interface {
// Diff compares two objects and returns an ASCII Diff string.
Diff(before, after any) (asciiDiff string, err error)
}
Differ defines the contract for comparing two objects and generating a diff.
func NewJSONASCIIDiffer ¶
func NewJSONASCIIDiffer() Differ
NewJSONASCIIDiffer creates a new JSON differ that outputs ANSI-colored ASCII diffs.
func NewJSONDiffer ¶
func NewJSONDiffer() Differ
NewJSONDiffer creates a new JSON differ that strips ANSI colors. It accepts nil, map[string]any, []any, or any strong-typed value which will be normalized via JSON round-trip.
type UnifiedDiffFormatDiffer ¶
type UnifiedDiffFormatDiffer struct{}
UnifiedDiffFormatDiffer generates a diff in a format similar to `git diff`.
func NewUnifiedDiffFormatDiffer ¶
func NewUnifiedDiffFormatDiffer() *UnifiedDiffFormatDiffer
NewUnifiedDiffFormatDiffer creates a new GitDiffer.
Click to show internal directories.
Click to hide internal directories.