runner

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner interface {
	// Run executes a command, returning combined output and error.
	Run(name string, args ...string) ([]byte, error)
	// RunAttached executes a command with stdin/stdout/stderr attached to the terminal.
	RunAttached(name string, args ...string) error
	// RunBackground starts a command detached from the terminal and returns immediately.
	// Stdin/stdout/stderr are connected to /dev/null.
	RunBackground(name string, args ...string) error
	// LookPath checks if a binary is in PATH.
	LookPath(name string) (string, error)
}

Runner executes system commands. Mockable for tests.

type SystemRunner

type SystemRunner struct{}

SystemRunner executes real system commands.

func (*SystemRunner) LookPath

func (r *SystemRunner) LookPath(name string) (string, error)

func (*SystemRunner) Run

func (r *SystemRunner) Run(name string, args ...string) ([]byte, error)

func (*SystemRunner) RunAttached

func (r *SystemRunner) RunAttached(name string, args ...string) error

func (*SystemRunner) RunBackground

func (r *SystemRunner) RunBackground(name string, args ...string) error

Jump to

Keyboard shortcuts

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