// MockExecHelper implements the logic for the helper process.
//
// This function should be called from a test stub in your program used
// exclusively for creating processes. The test stub shouldn't do anything
// else.
MockExecHelper implements the logic for the helper process.

This function should be called from a test stub in your program used
exclusively for creating processes. The test stub shouldn't do anything
else.
// MockExecHelper implements the logic for the helper process . // // This function should be called from a test stub in your program used // exclusively for creating processes . The test stub shouldn ' t do anything // else .
func MockExecHelper() {
	if os.Getenv("MOCK_EXEC_HELPER_PROCESS") != "1" {
		return
	}
	sleepstr := os.Getenv("MOCK_EXEC_SLEEP")
	if sleepstr != "" {
		dur, err := strconv.ParseInt(sleepstr, 10, 32)
		if err == nil && dur > 0 {
			time.Sleep(time.Duration(dur))
		}
	}
	out := os.Getenv("MOCK_EXEC_OUTPUT")
	if out != "" {
		fmt.Print(out)
	}
	var exitcode int64
	ecs := os.Getenv("MOCK_EXEC_EXIT_CODE")
	if ecs != "" {
		exitcode, _ = strconv.ParseInt(ecs, 10, 32)
	}
	os.Exit(int(exitcode))
}
func MockExecHelper ( ) { if os . Getenv ( " " ) != " " { return } sleepstr := os . Getenv ( " " ) if sleepstr != " " { dur , err := strconv . ParseInt ( sleepstr , 10 , 32 ) if err == nil && dur > 0 { time . Sleep ( time . Duration ( dur ) ) } } out := os . Getenv ( " " ) if out != " " { fmt . Print ( out ) } var exitcode int64 ecs := os . Getenv ( " " ) if ecs != " " { exitcode , _ = strconv . ParseInt ( ecs , 10 , 32 ) } os . Exit ( int ( exitcode ) ) }
MockExecHelper implements the logic for the helper process.
MockExecHelper implements the logic for the helper process .