diff

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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