github.com/whiteboxio/flow@v0.0.3-0.20190918184116-508d75d68a2c/pkg/util/util.go (about)

     1  package util
     2  
     3  type Failer func() error
     4  
     5  func ExecEnsure(failers ...Failer) error {
     6  	for _, failer := range failers {
     7  		if err := failer(); err != nil {
     8  			return err
     9  		}
    10  	}
    11  	return nil
    12  }