consistent reciever names

This commit is contained in:
James Bardin 2020-11-30 17:12:00 -05:00
parent b2d0e20759
commit c5299b5745
2 changed files with 8 additions and 8 deletions

View File

@ -29,13 +29,13 @@ type contextualFromConfigBody interface {
// InConfigBody returns a copy of the receiver with any config-contextual // InConfigBody returns a copy of the receiver with any config-contextual
// diagnostics elaborated in the context of the given body. // diagnostics elaborated in the context of the given body.
func (d Diagnostics) InConfigBody(body hcl.Body) Diagnostics { func (diags Diagnostics) InConfigBody(body hcl.Body) Diagnostics {
if len(d) == 0 { if len(diags) == 0 {
return nil return nil
} }
ret := make(Diagnostics, len(d)) ret := make(Diagnostics, len(diags))
for i, srcDiag := range d { for i, srcDiag := range diags {
if cd, isCD := srcDiag.(contextualFromConfigBody); isCD { if cd, isCD := srcDiag.(contextualFromConfigBody); isCD {
ret[i] = cd.ElaborateFromConfigBody(body) ret[i] = cd.ElaborateFromConfigBody(body)
} else { } else {

View File

@ -98,12 +98,12 @@ func (r SourceRange) ToHCL() hcl.Range {
// problem, but could produce an awkward result in some special cases such // problem, but could produce an awkward result in some special cases such
// as converting the result of ConsolidateWarnings, which will force the // as converting the result of ConsolidateWarnings, which will force the
// resulting warning groups to be flattened early. // resulting warning groups to be flattened early.
func (d Diagnostics) ToHCL() hcl.Diagnostics { func (diags Diagnostics) ToHCL() hcl.Diagnostics {
if len(d) == 0 { if len(diags) == 0 {
return nil return nil
} }
ret := make(hcl.Diagnostics, len(d)) ret := make(hcl.Diagnostics, len(diags))
for i, diag := range d { for i, diag := range diags {
severity := diag.Severity() severity := diag.Severity()
desc := diag.Description() desc := diag.Description()
source := diag.Source() source := diag.Source()