diff

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDiffOptions = &DiffOptions{
	IgnoreIndex: false,
}
View Source
var DefaultOutputOptions = &OutputOptions{
	Plain:    false,
	Silent:   false,
	Metadata: false,
}

Functions

This section is empty.

Types

type Diff

type Diff struct {
	NodeLeft  ast.Node
	NodeRight ast.Node
}

type DiffContext

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

func NewDiffContext

func NewDiffContext(filenameLeft, filenameRight string, comments bool) (*DiffContext, error)

func NewDiffContextBytes

func NewDiffContextBytes(left, right []byte, comments bool) (*DiffContext, error)

func (*DiffContext) Diffs

func (c *DiffContext) Diffs(conf *DiffOptions) FileDiffs

type DiffOptions

type DiffOptions struct {
	IgnoreIndex bool
}

type DocDiffs

type DocDiffs []*Diff

func NewDocDiffs

func NewDocDiffs(ln, rn *ast.DocumentNode, conf *DiffOptions) DocDiffs

func (DocDiffs) Len

func (a DocDiffs) Len() int

func (DocDiffs) Less

func (a DocDiffs) Less(i, j int) bool

func (DocDiffs) OutputString

func (d DocDiffs) OutputString(opts *OutputOptions) string

func (DocDiffs) Swap

func (a DocDiffs) Swap(i, j int)

type FileDiffs

type FileDiffs []DocDiffs

func NewFileDiffs

func NewFileDiffs(ln, rn *ast.File, conf *DiffOptions) FileDiffs

func (FileDiffs) HasDifference

func (d FileDiffs) HasDifference() bool

func (FileDiffs) OutputString

func (d FileDiffs) OutputString(opts *OutputOptions) string

type OutputOptions

type OutputOptions struct {
	Plain    bool
	Silent   bool
	Metadata bool
}

Jump to

Keyboard shortcuts

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