1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
package procs_test import ( "fmt" "os/exec" "github.com/ionrock/procs" ) func Example_predefinedCmds() { p := procs.Process{ Cmds: []*exec.Cmd{ exec.Command("echo", "foo"), exec.Command("grep", "foo"), }, } p.Run() out, _ := p.Output() fmt.Println(string(out)) // Output: // foo }