github.com/mackerelio/mackerel-agent-plugins@v0.89.3/mackerel-plugin-unicorn/lib/command.go (about) 1 package mpunicorn 2 3 import "os/exec" 4 5 // Command interface 6 type Command interface { 7 Output(string, ...string) ([]byte, error) 8 } 9 10 // RealCommand struct 11 type RealCommand struct{} 12 13 var command Command 14 15 // Output for RealCommand 16 func (r RealCommand) Output(command string, args ...string) ([]byte, error) { 17 out, err := exec.Command(command, args...).Output() 18 return out, err 19 }