Stop sending boot commands when context canceled.

This commit is contained in:
Matthew Hooker 2018-04-15 22:08:40 -07:00
parent 9a839c401b
commit add7e8acb9
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 3 additions and 0 deletions

View File

@ -50,6 +50,9 @@ type expressionSequence []expression
// Do executes every expression in the sequence and then finalizes the driver. // Do executes every expression in the sequence and then finalizes the driver.
func (s expressionSequence) Do(ctx context.Context, b BCDriver) error { func (s expressionSequence) Do(ctx context.Context, b BCDriver) error {
for _, exp := range s { for _, exp := range s {
if err := ctx.Err(); err != nil {
return err
}
if err := exp.Do(ctx, b); err != nil { if err := exp.Do(ctx, b); err != nil {
return err return err
} }