diff

package
v0.5.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Diff related utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff []diff.Chunk

Diff represents a collection of chunks that describe the difference between two texts. Each chunk describes a series of added, deleted, and equal lines. The primary purpose of Diff is to display text differences in a readable format, with added lines prefixed with '+' and deleted lines prefixed with '-'. ANSI colors are used unless color.NoColor is set.

func DiffAsYaml

func DiffAsYaml(a, b any) Diff

DiffAsYaml converts both interfaces to yaml and diffs them.

func (Diff) HasChanges

func (cs Diff) HasChanges() bool

HasChanges return true when the chunks contains changes.

func (Diff) String

func (cs Diff) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL