Discover Packages
github.com/obutora/stagent
internal
linediff
package
Version:
v0.30.0
Opens a new window with list of versions in this module.
Published: Dec 4, 2026
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0 modules, 0 packages
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package linediff compares texts line by line (Myers) and renders the
difference as a unified diff.
func Count(old, new []byte ) (added, removed int )
Count reports how many lines going from old to new adds and removes.
func HunkHeader(aStart, aLen, bStart, bLen int ) string
HunkHeader is the "@@ … @@" line of a hunk that starts at the 0-based
lines aStart / bStart and spans aLen / bLen lines, without the newline.
Hunks renders the hunks of a unified diff from old to new, without the
file header; "" when they are equal.
SplitLines splits after each '\n', keeping the terminator so that a final
line without newline differs from the same line with one.
Unified renders a unified diff from old to new for path. A nil old
means the file is created, a nil new that it is deleted. Equal inputs give
"".
Source Files
¶
Click to show internal directories.
Click to hide internal directories.