Documentation
¶
Index ¶
- type Command
- func (cmd *Command) AddArguments(args ...string) *Command
- func (cmd *Command) AddEnvs(envs ...string) *Command
- func (cmd *Command) Run() (output []byte, err error)
- func (cmd *Command) RunDir(dir string) *Command
- func (cmd *Command) RunWithPipe(stdout, stderr io.Writer) (err error)
- func (cmd *Command) SetTimeout(timeout time.Duration) *Command
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 运行的Shell指令需要参数
func (*Command) AddArguments ¶
AddArguments 为运行的指令添加参数
func (*Command) RunWithPipe ¶
RunWithPipe 运行指令,并将命令运行时的标准输出,和标准错误分别输出到stdout, stderr 如果指令运行失败,会返回err
Click to show internal directories.
Click to hide internal directories.