callchain.go 149 B

1234567891011
  1. package errorx
  2. func Chain(fns ...func() error) error {
  3. for _, fn := range fns {
  4. if err := fn(); err != nil {
  5. return err
  6. }
  7. }
  8. return nil
  9. }