Version: v2.14.3-0...-38bcd4a Latest Latest

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 7 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Cmd

type Cmd struct {
	Name   string
	Args   []string
	Stdin  *os.File
	Stdout *os.File
	Stderr *os.File

Cmd is a project-wide struct that represents a command to be run in the console.

func New

func New(name string) *Cmd

func NewWithArray

func NewWithArray(cmd []string) *Cmd

func (*Cmd) CombinedOutput

func (cmd *Cmd) CombinedOutput() (string, error)

func (*Cmd) Exec

func (cmd *Cmd) Exec() error

Exec runs command with exec(3) Note that Windows doesn't support exec(3):

func (*Cmd) Output

func (cmd *Cmd) Output() (string, error)

func (*Cmd) Run

func (cmd *Cmd) Run() error

Run runs command with `Exec` on platforms except Windows which only supports `Spawn`

func (*Cmd) Spawn

func (cmd *Cmd) Spawn() error

Spawn runs command with spawn(3)

func (Cmd) String

func (cmd Cmd) String() string

func (*Cmd) Success

func (cmd *Cmd) Success() bool

func (*Cmd) WithArg

func (cmd *Cmd) WithArg(arg string) *Cmd

WithArg returns the current argument

func (*Cmd) WithArgs

func (cmd *Cmd) WithArgs(args ...string) *Cmd

Source Files

Jump to

Keyboard shortcuts

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