gitlab.com/evatix-go/core@v1.3.55/conditional/ErrorFunctionsExecuteResults.go (about)

     1  package conditional
     2  
     3  // ErrorFunctionsExecuteResults execute error functions based on condition and returns final error
     4  func ErrorFunctionsExecuteResults(
     5  	isTrue bool,
     6  	trueValueFunctions []func() error,
     7  	falseValueFunctions []func() error,
     8  ) error {
     9  	if isTrue {
    10  		return executeErrorFunctions(trueValueFunctions)
    11  	}
    12  
    13  	return executeErrorFunctions(falseValueFunctions)
    14  }