diff

package
v0.19.810 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: AGPL-3.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Key      string
	Diff     *DiffKey
	Children []*Diff
}

func NewDiff

func NewDiff(opts ...DiffOption) *Diff

func (*Diff) String

func (d *Diff) String(indent string) string

func (*Diff) Summary

func (d *Diff) Summary() DiffSummary

type DiffKey

type DiffKey struct {
	Op   Op
	Diff string
}

type DiffOption

type DiffOption func(*Diff)

func WithChildren

func WithChildren(children ...*Diff) DiffOption

func WithKey

func WithKey(key string) DiffOption

func WithStringDiff

func WithStringDiff(old, new string) DiffOption

type DiffSummary

type DiffSummary struct {
	HasChanged bool
	Added      int
	Removed    int
	Changed    int
	Unchanged  int
}

type Diffable

type Diffable interface {
	Diff() (string, Op)
}

type Op

type Op string
const (
	OpAdd     Op = "add"
	OpRemove  Op = "remove"
	OpChange  Op = "change"
	OpNoop    Op = "noop"
	OpUnknown Op = ""
)

type StringDiffer

type StringDiffer struct {
	// contains filtered or unexported fields
}

func (*StringDiffer) Diff

func (d *StringDiffer) Diff() (string, Op)

Jump to

Keyboard shortcuts

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