You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package errorx
|
|
|
|
|
|
|
|
// Chain runs funs one by one until an error occurred.
|
|
|
|
func Chain(fns ...func() error) error {
|
|
|
|
for _, fn := range fns {
|
|
|
|
if err := fn(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|