shell

package
v0.0.0-...-fa603ae Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Exec executes program with args, and returns stdout if the return code is zero.
	// If nonzero, stderr is included in error.
	Exec(program string, args ...string) (string, error)
	// ExecLines is similar to Exec, except it splits the output on newlines. All empty
	// lines are discarded.
	ExecLines(program string, args ...string) ([]string, error)
}

Executor is a shim over cmd.Output() that allows for testing.

func NewShellExecutor

func NewShellExecutor() Executor

NewShellExecutor creates a shell.Executor that is implemented by exec.Command.

Jump to

Keyboard shortcuts

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