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

Function PartialDecode

hcldec/public.go:28–30  ·  view source on GitHub ↗

PartialDecode is like Decode except that it permits "leftover" items in the top-level body, which are returned as a new body to allow for further processing. Any descendent block bodies are _not_ decoded partially and thus must be fully described by the given specification.

(body hcl.Body, spec Spec, ctx *hcl.EvalContext)

Source from the content-addressed store, hash-verified

26// Any descendent block bodies are _not_ decoded partially and thus must
27// be fully described by the given specification.
28func PartialDecode(body hcl.Body, spec Spec, ctx *hcl.EvalContext) (cty.Value, hcl.Body, hcl.Diagnostics) {
29 return decode(body, nil, ctx, spec, true)
30}
31
32// ImpliedType returns the value type that should result from decoding the
33// given spec.

Callers 2

TestExpandFunction · 0.92
TestExpandUnknownBodiesFunction · 0.92

Calls 1

decodeFunction · 0.85

Tested by 2

TestExpandFunction · 0.74
TestExpandUnknownBodiesFunction · 0.74