...

Package differ

import "github.com/bazelbuild/buildtools/differ"
Overview
Index

Overview ▾

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

type Differ

A Differ describes how to invoke diff.

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

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.