(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value)
| 41 | } |
| 42 | |
| 43 | func decodeBodyToValue(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { |
| 44 | et := val.Type() |
| 45 | switch et.Kind() { |
| 46 | case reflect.Struct: |
| 47 | return decodeBodyToStruct(body, ctx, val) |
| 48 | case reflect.Map: |
| 49 | return decodeBodyToMap(body, ctx, val) |
| 50 | default: |
| 51 | panic(fmt.Sprintf("target value must be pointer to struct or map, not %s", et.String())) |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | func decodeBodyToStruct(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { |
| 56 | schema, partial := ImpliedBodySchema(val.Interface()) |
no test coverage detected