Documentation
¶
Index ¶
- type Command
- func (self *Command) CombinedOutput() ([]byte, error)
- func (self *Command) Dir(dir string) *Command
- func (self *Command) Env(env []string) *Command
- func (self *Command) ExitCode() int
- func (self *Command) Interactive() *Command
- func (self *Command) JustOutputLines() []string
- func (self *Command) JustOutputString() string
- func (self *Command) MustCombinedOutput() []byte
- func (self *Command) MustOutput() []byte
- func (self *Command) MustOutputLines() []string
- func (self *Command) MustOutputString() string
- func (self *Command) MustRun()
- func (self *Command) Output() ([]byte, error)
- func (self *Command) OutputLines() ([]string, error)
- func (self *Command) OutputString() (string, error)
- func (self *Command) Passthrough() *Command
- func (self *Command) Quiet() *Command
- func (self *Command) Run() error
- func (self *Command) Stderr(w io.Writer) *Command
- func (self *Command) Stdin(r io.Reader) *Command
- func (self *Command) Stdout(w io.Writer) *Command
- func (self *Command) Success() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is a fluent builder for executing external commands.
func (*Command) CombinedOutput ¶
CombinedOutput runs the command and returns its combined stdout and stderr.
func (*Command) ExitCode ¶
ExitCode runs the command and returns its exit code. Returns -1 if the command failed to start.
func (*Command) Interactive ¶
Interactive connects stdin, stdout, and stderr to os.Stdin, os.Stdout, and os.Stderr.
func (*Command) JustOutputLines ¶
JustOutputLines runs the command and returns its stdout as a slice of lines, or an empty slice if the command fails.
func (*Command) JustOutputString ¶
JustOutputString runs the command and returns its stdout as a trimmed string, or an empty string if the command fails.
func (*Command) MustCombinedOutput ¶
MustCombinedOutput runs the command and returns its combined stdout and stderr, panicking if it fails.
func (*Command) MustOutput ¶
MustOutput runs the command and returns its stdout, panicking if it fails.
func (*Command) MustOutputLines ¶
MustOutputLines runs the command and returns its stdout as a slice of lines, panicking if it fails.
func (*Command) MustOutputString ¶
MustOutputString runs the command and returns its stdout as a trimmed string, panicking if it fails.
func (*Command) MustRun ¶
func (self *Command) MustRun()
MustRun runs the command and panics if it fails.
func (*Command) OutputLines ¶
OutputLines runs the command and returns its stdout as a slice of lines.
func (*Command) OutputString ¶
OutputString runs the command and returns its stdout as a trimmed string.
func (*Command) Passthrough ¶
Passthrough connects stdout and stderr to os.Stdout and os.Stderr.