(body hcl.Body)
| 43 | } |
| 44 | |
| 45 | func parseVarsBody(body hcl.Body) (map[string]cty.Value, hcl.Diagnostics) { |
| 46 | attrs, diags := body.JustAttributes() |
| 47 | if attrs == nil { |
| 48 | return nil, diags |
| 49 | } |
| 50 | |
| 51 | vals := make(map[string]cty.Value, len(attrs)) |
| 52 | for name, attr := range attrs { |
| 53 | val, valDiags := attr.Expr.Value(nil) |
| 54 | diags = append(diags, valDiags...) |
| 55 | vals[name] = val |
| 56 | } |
| 57 | return vals, diags |
| 58 | } |
| 59 | |
| 60 | // varSpecs is an implementation of pflag.Value that accumulates a list of |
| 61 | // raw values, ignoring any quoting. This is similar to pflag.StringSlice |
no test coverage detected