diff

package
v0.0.0-...-08a0481 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Patch

type Patch struct {
	PathA      string
	PathB      string
	SizeChange string
	Lines      []PatchLine
}

Patch represents a single file diff. File was created/deleted when one of "PathA" or "PathB" is empty. File was renamed when "PathA" and "PathB" are not equal.

func Compare

func Compare(a, b string) ([]*Patch, error)

Compare diffs the contents of two directories. The current implementation uses "git-diff-tree" to detect renames. Whitespace changes are ignored.

type PatchLine

type PatchLine struct {
	LineA   int
	LineB   int
	Content string
}

PatchLine represents a single line of diff output. Line was created/deleted when one of "LineA" or "LineB" is zero. Hunks starts when both "LineA" and "LineB" are zero.

Jump to

Keyboard shortcuts

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