Esempio n. 1
0
func ExampleExecution_ErrOutput() {
	Retry := execution.Execution{Count: 1, Interval: 1000, IsLock: true}
	Retry.SetMutex(lock)
	_, err := Retry.ErrOutput([]string{"ls", "."})
	if err != nil {
		fmt.Println("ERROR")
	} else {
		fmt.Println("OK")
	}

	// Output:
	// OK
}
Esempio n. 2
0
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
}