Skip to content

Commit c549c67

Browse files
authored
Skip un-used variable block attributes (#153)
1 parent 3d6d075 commit c549c67

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

helper/runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func decodeVariableBlock(block *hcl.Block) (*Variable, hcl.Diagnostics) {
238238
DeclRange: block.DefRange,
239239
}
240240

241-
content, diags := block.Body.Content(&hcl.BodySchema{
241+
content, _, diags := block.Body.PartialContent(&hcl.BodySchema{
242242
Attributes: []hcl.AttributeSchema{
243243
{
244244
Name: "default",

helper/runner_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ resource "aws_instance" "foo" {
265265
Name: "string interpolation",
266266
Src: `
267267
variable "instance_type" {
268+
type = string
268269
default = "t2.micro"
269270
}
270271

0 commit comments

Comments
 (0)