diff

package
v1.6.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package diff provides a memory-safe unified diff computation.

Index

Constants

View Source
const MaxLines = 75_000

MaxLines is the maximum total number of lines (old + new) for which a full structural diff is computed. Beyond this the diff is summarized because no human can meaningfully review it and the algorithmic cost becomes prohibitive.

Variables

This section is empty.

Functions

func Compute

func Compute(previousData, newData []byte) (string, error)

Compute returns a unified diff (without the --- / +++ header) between two byte slices. For inputs whose combined line count exceeds MaxLines it returns a short summary instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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