Skip to content

Commit a584c7b

Browse files
committed
comments
1 parent bb65746 commit a584c7b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/proto5server/server_listresource.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@ func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov5.ListResou
6464
return ListRequestErrorDiagnostics(ctx, allDiags...)
6565
}
6666

67+
// For something that passes a test, use presence of SDKResource in the context
68+
// to choose our adventure. We can refactor this to something more general
69+
// that does not couple to SDK.
6770
_, ok := SDKResourceFromContext(ctx)
71+
6872
switch ok {
6973
case true:
74+
// A simpler path for list resources that return tfprotov5 results
7075
req := list.ListRequest{}
7176
stream := list.ListResultsStream{Proto5Results: tfprotov5.NoListResults}
7277
listResource.List(ctx, req, &stream)

0 commit comments

Comments
 (0)