command

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 8 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	CommSuppressColumn1   commSuppress1Flag = true
	CommNoSuppressColumn1 commSuppress1Flag = false
)
View Source
const (
	CommSuppressColumn2   commSuppress2Flag = true
	CommNoSuppressColumn2 commSuppress2Flag = false
)
View Source
const (
	CommSuppressColumn3   commSuppress3Flag = true
	CommNoSuppressColumn3 commSuppress3Flag = false
)

Variables

This section is empty.

Functions

func Comm

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

Comm compares two sorted line streams and emits three columns:

  • Column 1 (no indent): lines only in input1.
  • Column 2 (one tab): lines only in input2.
  • Column 3 (two tabs): lines in both.

Opts:

  • 1st positional file/Reader: input1 (overrides the upstream stream).
  • 2nd positional file/Reader: input2.
  • CommInput: input2 as raw lines (highest precedence for input2).
  • CommSuppressColumn1 / 2 / 3: hide that column from output.
  • CommFs: filesystem used to open File positionals (defaults to the OS).

Suppression also collapses leading-tab indentation: when column 1 is suppressed, columns 2 and 3 lose their leading tab; when column 2 is also suppressed, column 3 loses its second tab. This matches GNU comm.

Types

type CommFs

type CommFs afero.Fs

CommFs selects the filesystem comm uses to open File positional arguments, so tests can supply an in-memory filesystem: CommFs(afero.NewMemMapFs()). When absent, comm falls back to the OS filesystem.

type CommInput

type CommInput [][]byte

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

Directories

Path Synopsis
Package alias provides unprefixed names for comm command flags.
Package alias provides unprefixed names for comm command flags.

Jump to

Keyboard shortcuts

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