Skip to content

Commit 48003cd

Browse files
committed
fixup invlaid 0 options
1 parent 4d49d67 commit 48003cd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: extract/parameter.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,13 @@ func ParameterUsageDiagnostics(p types.Parameter) hcl.Diagnostics {
165165
}
166166
}
167167

168-
diags = diags.Append(&hcl.Diagnostic{
169-
Severity: hcl.DiagError,
170-
Summary: fmt.Sprintf("Parameter contains %d invalid options", badOpts),
171-
Detail: "The set of options cannot be resolved, and use of the parameter is limited.",
172-
})
168+
if badOpts > 0 {
169+
diags = diags.Append(&hcl.Diagnostic{
170+
Severity: hcl.DiagError,
171+
Summary: fmt.Sprintf("Parameter contains %d invalid options", badOpts),
172+
Detail: "The set of options cannot be resolved, and use of the parameter is limited.",
173+
})
174+
}
173175

174176
return diags
175177
}

0 commit comments

Comments
 (0)