host

package
v87.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package host provides facilities for interfacing with the host operating system, logging activities performed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinedOutput

func CombinedOutput(name string, arg ...string) (combinedOutput string, err error)

CombinedOutput is equivalent to exec.Command(name, arg...).CombinedOutput() but with logging.

func Output

func Output(name string, arg ...string) (string, error)

Output is like CombinedOutput but only returns Standard Out output. If an error is encountered, both standard error and standard output are logged.

func Run

func Run(name string, arg ...string) (err error)

Run is equivalent to exec.Command(name, arg...).Run() but with logging.

func RunBatch

func RunBatch(allowFail bool, commands ...[]string) (err error)

RunBatch calls Run for each command in commands, in sequence. If allowFail is false it will return if an error is returned from Run. All errors are logged regardless of allowFail. The returned error is the result of the last Run call.

func RunIgnoreError

func RunIgnoreError(errString string, command string, args ...string) (found bool, err error)

RunIgnoreError calls CombinedOutput(comand, args...). If errString is found in the command output, found is true and err is nil. Otherwise found is false, and err is the error returned from CombinedOutput (possibly nil).

Types

This section is empty.

Jump to

Keyboard shortcuts

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