consistent reciever names
This commit is contained in:
parent
b2d0e20759
commit
c5299b5745
|
@ -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 {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue