diff

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package diff renders line diffs between two versions of a file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBinary

func IsBinary(b []byte) bool

IsBinary reports content that should not be shown as text. Like git, it looks for a NUL byte in the first 8000 bytes: text in a legacy encoding (CP949, Shift-JIS, Latin-1) is not valid UTF-8 but is still text.

func Unified

func Unified(name string, old, new []byte) (string, bool)

Unified returns a unified diff with 3 lines of context, "" when equal. The second result is true when either side is binary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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