diff

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package diff contains primitives for diff-ing objects and strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Objects

func Objects(left, right interface{}, opts Options) ([]byte, error)

Objects renders the left and right objects passed to it as YAML and returns the diff. A zero-length slice is returned when there are no diffs.

func Strings

func Strings(left, right string, opts Options) ([]byte, error)

Strings diffs the left and right strings and returns the diff. A zero-length slice is returned when there are no diffs.

Types

type Options

type Options struct {
	LeftName  string // name of left side
	RightName string // name of right side
	Context   int    // number of context lines in the diff, defaults to 3
	Colorize  bool   // added colors to the diff
}

Options are options for the diff. The zero-value is valid. Use a negative number for the context if you really want 0 context lines.

Jump to

Keyboard shortcuts

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