osencap

package
v0.0.0-...-9649b88 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Exec = func(cmd string, args ...string) (string, error) {
	cmdpath, err := exec.LookPath(cmd)
	if err != nil {
		klog.Errorf("exec.LookPath err: %v, cmd: %s", err, cmd)
		return "", infra.ErrExecLookPathFailed
	}

	var output []byte
	output, err = exec.Command(cmdpath, args...).CombinedOutput()
	if err != nil {
		klog.Errorf("exec.Command.CombinedOutput err: %v, cmd: %s, output: %s", err, cmd, string(output))
		return "", infra.ErrExecCombinedOutputFailed
	}

	return string(output), nil
}
View Source
var OsStat = func(name string) (os.FileInfo, error) {
	return os.Stat(name)
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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