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

Function SourceRange

hcldec/public.go:54–56  ·  view source on GitHub ↗

SourceRange interprets the given body using the given specification and then returns the source range of the value that would be used to fulfill the spec. This can be used if application-level validation detects value errors, to obtain a reasonable SourceRange to use for generated diagnostics. It w

(body hcl.Body, spec Spec)

Source from the content-addressed store, hash-verified

52// will already have used Decode or PartialDecode earlier and thus had an
53// opportunity to detect and report spec violations.
54func SourceRange(body hcl.Body, spec Spec) hcl.Range {
55 return sourceRange(body, nil, spec)
56}
57
58// ChildBlockTypes returns a map of all of the child block types declared
59// by the given spec, with block type names as keys and the associated

Callers 1

TestSourceRangeFunction · 0.85

Calls 1

sourceRangeFunction · 0.85

Tested by 1

TestSourceRangeFunction · 0.68