diffutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package diffutil is a small pure-Go line diff producing unified-style hunks. It exists so the engine can render schema diffs without shelling out to diff(1) or adding a dependency.

The edit script comes from Myers' O(ND) algorithm in its linear-space divide-and-conquer form (the same shape as GNU diff's diffseq): memory is O(N+M) whatever the inputs, and a cost cap bounds the time spent on inputs that differ almost everywhere (see tooExpensive).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unified

func Unified(a, b string) string

Unified returns a unified-style line diff of a and b ("@@ -i,n +j,m @@" hunks with contextLines of context, no file headers), or "" when the inputs are line-equal. Trailing-newline-only differences are ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

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