package kubectl import ( "os/exec" ) type KubectlCommand struct { Bin string Exec func(string,...string) commandExecutor } //// type commandExecutor interface { Output() ([]byte, error) CombinedOutput() ([]byte, error) } func (this *KubectlCommand) New() { this.Exec = func(name string, arg ...string) commandExecutor { return exec.Command(name, arg...) } }