MCPcopy
hub / github.com/hashicorp/hcl / setDiagEvalContext

Function setDiagEvalContext

hclsyntax/diagnostics.go:19–26  ·  view source on GitHub ↗

setDiagEvalContext is an internal helper that will impose a particular EvalContext on a set of diagnostics in-place, for any diagnostic that does not already have an EvalContext set. We generally expect diagnostics to be immutable, but this is safe to use on any Diagnostics where none of the contai

(diags hcl.Diagnostics, expr hcl.Expression, ctx *hcl.EvalContext)

Source from the content-addressed store, hash-verified

17// set of diagnostics produced by a "deeper" component as the stack unwinds
18// during expression evaluation.
19func setDiagEvalContext(diags hcl.Diagnostics, expr hcl.Expression, ctx *hcl.EvalContext) {
20 for _, diag := range diags {
21 if diag.Expression == nil {
22 diag.Expression = expr
23 diag.EvalContext = ctx
24 }
25 }
26}

Callers 3

ValueMethod · 0.85
ValueMethod · 0.85
ValueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected