Skip to content

Commit e5bd162

Browse files
committed
remove redundant return statement and skip over nil messages
1 parent 0bebb21 commit e5bd162

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

internal/plugintest/working_dir.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,9 +538,14 @@ func (wd *WorkingDir) Query(ctx context.Context) ([]tfjson.LogMsg, error) {
538538
}
539539

540540
for msg := range logs {
541+
if msg.Msg == nil {
542+
continue
543+
}
544+
541545
if msg.Err != nil {
542546
return nil, fmt.Errorf("retrieving next message: %w", msg.Err)
543547
}
548+
544549
if msg.Msg.Level() == tfjson.Error {
545550
// TODO reimplement missing .tf config error
546551
diags = append(diags, msg.Msg)

querycheck/expect_identity.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ func (e expectIdentity) CheckQuery(_ context.Context, req CheckQueryRequest, res
7979
}
8080
errCollection = append(errCollection, fmt.Errorf("address: %s\n", e.listResourceAddress))
8181
resp.Error = errors.Join(errCollection...)
82-
83-
return
8482
}
8583

8684
// ExpectIdentity returns a query check that asserts that the identity at the given resource matches a known object, where each

0 commit comments

Comments
 (0)