diff

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Colorize

func Colorize(diff string) string

Colorize adds ANSI colors to unified diff output.

func DiffJSON

func DiffJSON(a, b []byte, contextLines int) (string, error)

DiffJSON normalizes both inputs (sorted keys, consistent indent) then diffs.

func DiffText

func DiffText(a, b []byte, contextLines int) string

DiffText returns a unified diff of two text inputs.

func ReadTwoInputs

func ReadTwoInputs(args []string, stdin io.Reader) ([]byte, []byte, error)

ReadTwoInputs reads two file-or-stdin inputs. "-" means stdin (at most one).

Types

This section is empty.

Jump to

Keyboard shortcuts

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