textdiff

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package textdiff renders a content-anchored, unified-style line diff without line numbers: hunks are anchored by their context lines alone, so the output stays meaningful for a reader who holds the text but not its numbering (20260826-120330-d-tac-8f8).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadTail

func HeadTail(text string, head, tail int) string

HeadTail returns text bounded to its first head and last tail lines, the elided middle marked with a line count. Text short enough returns whole.

func Unified

func Unified(old, new string) string

Unified returns the line diff from old to new: hunks headed by a bare "@@", context prefixed with a space, removals with "-", additions with "+". Empty when the texts are equal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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