exec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdResult added in v0.9.1

func CmdResult(cmd string, args ...string) string

CmdResult always returns an informative description of what command ran and what the outcome (stdout+stderr, exit code if any) was. Logging is left entirely to the caller.

func Run

func Run(ctx context.Context, cmd *exec.Cmd) (string, error)

Run does the same as RunCommand but takes a pre-populated cmd. Stdout and stderr are ignored and replaced with the output handling described for RunCommand.

func RunCommand

func RunCommand(ctx context.Context, cmd string, args ...string) (string, error)

RunCommand executes the command with logging through klog, with output processed line-by-line with the command path as prefix. It returns the combined output and, if there was a problem, includes that output and the command in the error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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