func ExampleExecution_Output() { Redo := execution.Execution{Count: -1, Interval: 1000, IsLock: true} Redo.SetMutex(lock) _, err := Redo.Output([]string{"ls", "."}) if err == nil { // Notice: we run it until failed fmt.Println("ERROR") } else { fmt.Println("OK") } // Output: // ERROR }