differ

package
v0.0.0-...-77ffe55 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package differ determines how to invoke diff in the given environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Differ

type Differ struct {
	Cmd       string   // command
	MultiDiff bool     // diff accepts list of multiple pairs
	Args      []string // accumulated arguments
}

A Differ describes how to invoke diff.

func Find

func Find() (*Differ, bool)

Find returns the differ to use, using various environment variables.

func (*Differ) Run

func (d *Differ) Run() error

Run runs any pending diffs. For a single-pair diff program, Show already ran diff; Run is a no-op. For a multi-pair diff program, Run displays the diffs queued by Show.

func (*Differ) Show

func (d *Differ) Show(old, new string) error

Show diffs old and new. For a single-pair diff program, Show runs the diff program before returning. For a multi-pair diff program, Show records the pair for later use by Run.

Jump to

Keyboard shortcuts

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