command

package module
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 8 Imported by: 3 modules, 1 package

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.

README

Documentation

Index

Constants

View Source
const (
	DiffUnified   diffUnifiedFlag = true
	DiffNoUnified diffUnifiedFlag = false
)

Variables

This section is empty.

Functions

func Diff

func Diff(opts ...any) gloo.Command[[]byte, []byte]

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

type DiffFs

type DiffFs struct{ afero.Fs }

DiffFs injects the filesystem used to open File positionals, so tests can supply an in-memory filesystem. The zero value falls back to the OS.

type DiffInput

type DiffInput [][]byte

DiffInput supplies the second input as raw lines, taking precedence over any second positional file path.

Directories

Path Synopsis
Package alias provides unprefixed type aliases for diff command flags.
Package alias provides unprefixed type aliases for diff command flags.

Jump to

Keyboard shortcuts

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