Decode interprets the given body using the given specification and returns the resulting value. If the given body is not valid per the spec, error diagnostics are returned and the returned value is likely to be incomplete. The ctx argument may be nil, in which case any references to variables or fu
(body hcl.Body, spec Spec, ctx *hcl.EvalContext)
| 15 | // The ctx argument may be nil, in which case any references to variables or |
| 16 | // functions will produce error diagnostics. |
| 17 | func Decode(body hcl.Body, spec Spec, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { |
| 18 | val, _, diags := decode(body, nil, ctx, spec, false) |
| 19 | return val, diags |
| 20 | } |
| 21 | |
| 22 | // PartialDecode is like Decode except that it permits "leftover" items in |
| 23 | // the top-level body, which are returned as a new body to allow for |