Documentation
¶
Index ¶
- Constants
- Variables
- func ExitIfError(err error, args ...interface{})
- func ExitIfFalse(cond bool, args ...interface{})
- func Fatal(args ...interface{})
- func FatalIfError(t *testing.T, err error, args ...interface{})
- func PanicIfError(err error)
- type PipedExec
- func (Self *PipedExec) Command(name string, args ...string) *PipedExec
- func (Self *PipedExec) GetCmd(idx int) *exec.Cmd
- func (Self *PipedExec) Run(out io.Writer, err io.Writer) error
- func (Self *PipedExec) RunToStrings() (stdout string, stderr string, err error)
- func (Self *PipedExec) Start(out io.Writer, err io.Writer) error
- func (Self *PipedExec) Wait() error
- func (Self *PipedExec) WorkingDir(wd string) *PipedExec
Constants ¶
View Source
const ( StderrRedirectNone = iota StderrRedirectStdout StderrRedirectNull )
Stderr redirection
Variables ¶
View Source
var Doing func(arg interface{})
Doing printlns "$obj..." to stdout
View Source
var Error func(args ...interface{})
Error printlns to stdout
View Source
var ErrorPrefix = "*** "
ErrorPrefix prefixes Verbose output
View Source
var Info func(args ...interface{})
Info printlns to stdout
View Source
var IsVerbose = false
IsVerbose enables Verbose
View Source
var Output func(funcName, s string)
Output is used by all functions
View Source
var Verbose func(subj string, args ...interface{})
Verbose If IsVerbose is true printlns VerbosePrefix + subj + ": " + ...args args are printed in %#+v format (json-like)
View Source
var VerbosePrefix = "--- "
VerbosePrefix prefixes Verbose output
View Source
var VerboseWriters func() (out io.Writer, err io.Writer)
VerboseWriters returns (os.Stdout, os.Stderr) if IsVerbose, (ioutil.Discard, os.Stderr) otherwise
Functions ¶
func FatalIfError ¶ added in v1.9.0
FatalIfError calls t.Fatal(args, err) if err is not nil
Types ¶
type PipedExec ¶
type PipedExec struct {
// contains filtered or unexported fields
}
PipedExec allows to execute commands in pipe
func (*PipedExec) RunToStrings ¶ added in v1.8.0
RunToStrings runs the pipe and saves outputs to strings
func (*PipedExec) WorkingDir ¶
WorkingDir sets working directory for the last command
Click to show internal directories.
Click to hide internal directories.