diff --git a/addrs/parse_ref.go b/addrs/parse_ref.go index cd8b114f6..eac77f306 100644 --- a/addrs/parse_ref.go +++ b/addrs/parse_ref.go @@ -120,10 +120,9 @@ func parseRef(traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { return nil, diags } - // A traversal starting with "module" can either be a reference to - // an entire module instance or to a single output from a module - // instance, depending on what we find after this introducer. - + // A traversal starting with "module" can either be a reference to an + // entire module, or to a single output from a module instance, + // depending on what we find after this introducer. callInstance := ModuleCallInstance{ Call: ModuleCall{ Name: callName, @@ -132,12 +131,12 @@ func parseRef(traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { } if len(remain) == 0 { - // Reference to an entire module instance. Might alternatively - // be a reference to a collection of instances of a particular - // module, but the caller will need to deal with that ambiguity - // since we don't have enough context here. + // Reference to an entire module. Might alternatively be a + // reference to a single instance of a particular module, but the + // caller will need to deal with that ambiguity since we don't have + // enough context here. return &Reference{ - Subject: callInstance, + Subject: callInstance.Call, SourceRange: tfdiags.SourceRangeFromHCL(callRange), Remaining: remain, }, diags diff --git a/addrs/parse_ref_test.go b/addrs/parse_ref_test.go index be1eb244e..233bf8685 100644 --- a/addrs/parse_ref_test.go +++ b/addrs/parse_ref_test.go @@ -281,10 +281,8 @@ func TestParseRef(t *testing.T) { { `module.foo`, &Reference{ - Subject: ModuleCallInstance{ - Call: ModuleCall{ - Name: "foo", - }, + Subject: ModuleCall{ + Name: "foo", }, SourceRange: tfdiags.SourceRange{ Start: tfdiags.SourcePos{Line: 1, Column: 1, Byte: 0},