diff

package
v0.0.0-...-aaa21aa Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package diff implements the Myers diff algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyEdits

func ApplyEdits(a []string, operations []*Op) []string

Types

type Op

type Op struct {
	Kind    OpKind
	Content string
	I1, I2  int // indices of the line in a
	J1, J2  int // indices of the line in b
}

func Operations

func Operations(a, b []string) []*Op

Operations returns the list of operations to convert a into b, consolidating operations for multiple lines and not including equal lines.

type OpKind

type OpKind int
const (
	Delete OpKind = iota
	Insert
	Equal
)

func (OpKind) String

func (k OpKind) String() string

Jump to

Keyboard shortcuts

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