diff

package
v0.0.0-...-a8e4d9d Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TempFilePrefix = "harrow-diff-"

TempFilePrefix is the filename prefix used for temporary files written for interfacing with the `diff` tool.

Variables

View Source
var (
	Addition = ChangeType("added")
	Removal  = ChangeType("removed")
	Context  = ChangeType("context")
)

Functions

func Unified

func Unified(a, b []byte) ([]byte, error)

Unified returns a unified textual diff of a and b.

Types

type Change

type Change struct {
	Kind ChangeType
	Line int
	Text string
}

func Changes

func Changes(a, b []byte) ([]*Change, error)

Changes returns a list of changes extracted from a unified diff of a and b.

func (*Change) MarshalJSON

func (self *Change) MarshalJSON() ([]byte, error)

func (*Change) String

func (self *Change) String() string

func (*Change) UnmarshalJSON

func (self *Change) UnmarshalJSON(data []byte) error

type ChangeType

type ChangeType string

Jump to

Keyboard shortcuts

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