unused err value and nil context

Incorrect err assignment had no effect.

Never use a nil context.
This commit is contained in:
James Bardin 2020-12-01 09:10:01 -05:00
parent d2c2d58f09
commit 96436f526a
2 changed files with 2 additions and 2 deletions

View File

@ -495,10 +495,10 @@ func (b *Remote) confirm(stopCtx context.Context, op *backend.Operation, opts *t
}
if err == errRunDiscarded {
err = errApplyDiscarded
if op.Destroy {
err = errDestroyDiscarded
}
err = errApplyDiscarded
}
result <- err

View File

@ -195,7 +195,7 @@ func TestRemoteContextWithVars(t *testing.T) {
key := "key"
v.Key = &key
}
b.client.Variables.Create(nil, workspaceID, *v)
b.client.Variables.Create(context.TODO(), workspaceID, *v)
_, _, diags := b.Context(op)