Help us shape the future of Go! Take the 2026 Go Developer Survey

diffx

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package diffx renders line-based unified diffs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unified

func Unified(ops []LineOp, n int) string

Unified renders ops as unified hunks with n context lines, git style. It returns "" when ops contain no changes.

Types

type LineOp

type LineOp struct {
	Kind byte
	Text string
}

LineOp is one line of a diff: ' ' context, '-' removed, '+' added.

func LineDiff

func LineDiff(a, b string) []LineOp

LineDiff computes a line-level edit script from a to b. Trailing-newline differences are normalized away.

Jump to

Keyboard shortcuts

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