terraform: remove more nil panics (doesn't change test logic)

This commit is contained in:
Mitchell Hashimoto 2016-09-14 11:46:36 -07:00
parent 9ea9e52185
commit e784e4a434
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A

View File

@ -835,17 +835,21 @@ func TestContext2Apply_cancel(t *testing.T) {
} }
// Start the Apply in a goroutine // Start the Apply in a goroutine
var applyErr error
stateCh := make(chan *State) stateCh := make(chan *State)
go func() { go func() {
state, err := ctx.Apply() state, err := ctx.Apply()
if err != nil { if err != nil {
panic(err) applyErr = err
} }
stateCh <- state stateCh <- state
}() }()
state := <-stateCh state := <-stateCh
if applyErr != nil {
t.Fatalf("err: %s", applyErr)
}
mod := state.RootModule() mod := state.RootModule()
if len(mod.Resources) != 1 { if len(mod.Resources) != 1 {