diff --git a/tfdiags/contextual.go b/tfdiags/contextual.go index d55bc2f0c..f66e5d913 100644 --- a/tfdiags/contextual.go +++ b/tfdiags/contextual.go @@ -29,13 +29,13 @@ type contextualFromConfigBody interface { // InConfigBody returns a copy of the receiver with any config-contextual // diagnostics elaborated in the context of the given body. -func (d Diagnostics) InConfigBody(body hcl.Body) Diagnostics { - if len(d) == 0 { +func (diags Diagnostics) InConfigBody(body hcl.Body) Diagnostics { + if len(diags) == 0 { return nil } - ret := make(Diagnostics, len(d)) - for i, srcDiag := range d { + ret := make(Diagnostics, len(diags)) + for i, srcDiag := range diags { if cd, isCD := srcDiag.(contextualFromConfigBody); isCD { ret[i] = cd.ElaborateFromConfigBody(body) } else { diff --git a/tfdiags/hcl.go b/tfdiags/hcl.go index 37fb0d1ae..66e3e4258 100644 --- a/tfdiags/hcl.go +++ b/tfdiags/hcl.go @@ -98,12 +98,12 @@ func (r SourceRange) ToHCL() hcl.Range { // problem, but could produce an awkward result in some special cases such // as converting the result of ConsolidateWarnings, which will force the // resulting warning groups to be flattened early. -func (d Diagnostics) ToHCL() hcl.Diagnostics { - if len(d) == 0 { +func (diags Diagnostics) ToHCL() hcl.Diagnostics { + if len(diags) == 0 { return nil } - ret := make(hcl.Diagnostics, len(d)) - for i, diag := range d { + ret := make(hcl.Diagnostics, len(diags)) + for i, diag := range diags { severity := diag.Severity() desc := diag.Description() source := diag.Source()