executil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
}

Result contains captured command output.

func (*Result) StderrString

func (r *Result) StderrString() string

func (*Result) StdoutString

func (r *Result) StdoutString() string

type RunError

type RunError struct {
	Binary   string
	Args     []string
	ExitCode int
	Stderr   string
	Cause    error
}

RunError includes command details and captured stderr for failed runs.

func (*RunError) Error

func (e *RunError) Error() string

func (*RunError) Unwrap

func (e *RunError) Unwrap() error

type Runner

type Runner struct {
	Binary string
	Stdin  io.Reader
}

Runner executes external commands and always captures stdout/stderr.

func NewRunner

func NewRunner(binary string) *Runner

NewRunner creates a command runner for a binary.

func (*Runner) Run

func (r *Runner) Run(args ...string) (*Result, error)

Run executes a command and captures both stdout and stderr.

Jump to

Keyboard shortcuts

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