Documentation
¶
Index ¶
Constants ¶
View Source
const ( DiffUnified diffUnifiedFlag = true DiffNoUnified diffUnifiedFlag = false )
Variables ¶
This section is empty.
Functions ¶
func Diff ¶
Diff compares two line streams position by position and emits their differences.
Output format:
- default: ed-style — `< line` for an input1-only line, `> line` for an input2-only line, at each position where the lines differ.
- DiffUnified (-u): a unified diff with `--- a` / `+++ b` headers, a single `@@ -1,N +1,M @@` hunk, and `-line` / `+line` / ` line` body rows.
Opts:
- 1st positional file/Reader: input1 (overrides the upstream stream).
- 2nd positional file/Reader: input2.
- DiffInput: input2 as raw lines (highest precedence for input2).
- DiffUnified: switch output format.
- DiffFs: filesystem used to open File positionals (defaults to the OS).
Types ¶
Click to show internal directories.
Click to hide internal directories.