// Sequence runs the given computations one after another.
//
// If one of the functions fails, the sequence stops immediately and the error
// is returned.
// If the context expires between the functions, the context error is returned.
Sequence runs the given computations one after another.

If one of the functions fails, the sequence stops immediately and the error
is returned.
If the context expires between the functions, the context error is returned.
// Sequence runs the given computations one after another . // // If one of the functions fails the sequence stops immediately and the error // is returned . // If the context expires between the functions the context error is returned .
func Sequence(ctx context.Context, fns ...Func) error {
	for _, fn := range fns {
		if err := fn(ctx); err != nil {
			return err
		}
		if err := ctx.Err(); err != nil {
			return err
		}
	}
	return nil
}
func Sequence ( ctx context . Context , fns ... Func ) error { for _ , fn := range fns { if err := fn ( ctx ) ; err != nil { return err } if err := ctx . Err ( ) ; err != nil { return err } } return nil }
Sequence runs the given computations one after another.
Sequence runs the given computations one after another .