exec

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(ctx context.Context, cmdLine string, args []string, opts Options) (int, error)

Exec executes a command and returns the exit code.

Types

type Options

type Options struct {
	// Dir is the working directory of the command.
	// If empty, the current process's working directory is used.
	Dir string
	// Env is the environment to use for the command.
	// If nil, the current process's environment is used.
	Env []string
	// Silent is a flag to suppress output from the command.
	Silent bool
	// Stdout is the writer to write the output of the command to.
	// If nil, the output is written to os.Stdout.
	Stdout io.Writer
	// Stderr is the writer to write the error output of the command to.
	// If nil, the error output is written to os.Stderr.
	Stderr io.Writer
	// Stdin is the reader to read the input of the command from.
	Stdin io.Reader
	// WaitDelay is the time to wait for the I/O pipes to be closed.
	WaitDelay time.Duration
}

Options are options for the Exec function.

Jump to

Keyboard shortcuts

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