internal/typeexpr: staticcheck

diagnostics were appended to diags shadowing the intended value.
This commit is contained in:
James Bardin 2020-12-01 16:12:31 -05:00
parent e08422511e
commit 1f359bab03
1 changed files with 1 additions and 1 deletions

View File

@ -167,7 +167,7 @@ func getType(expr hcl.Expression, constraint bool) (cty.Type, hcl.Diagnostics) {
// modifier optional(...) to indicate an optional attribute. If
// so, we'll unwrap that first and make a note about it being
// optional for when we construct the type below.
if call, diags := hcl.ExprCall(atyExpr); !diags.HasErrors() {
if call, callDiags := hcl.ExprCall(atyExpr); !callDiags.HasErrors() {
if call.Name == "optional" {
if len(call.Arguments) < 1 {
diags = append(diags, &hcl.Diagnostic{