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)
| 52 | // will already have used Decode or PartialDecode earlier and thus had an |
| 53 | // opportunity to detect and report spec violations. |
| 54 | func 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 |