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

Function parseVarsArg

cmd/hcldec/vars.go:14–23  ·  view source on GitHub ↗
(src string, argIdx int)

Source from the content-addressed store, hash-verified

12)
13
14func parseVarsArg(src string, argIdx int) (map[string]cty.Value, hcl.Diagnostics) {
15 fakeFn := fmt.Sprintf("<vars argument %d>", argIdx)
16 f, diags := parser.ParseJSON([]byte(src), fakeFn)
17 if f == nil {
18 return nil, diags
19 }
20 vals, valsDiags := parseVarsBody(f.Body)
21 diags = append(diags, valsDiags...)
22 return vals, diags
23}
24
25func parseVarsFile(filename string) (map[string]cty.Value, hcl.Diagnostics) {
26 var f *hcl.File

Callers 1

realmainFunction · 0.85

Calls 2

parseVarsBodyFunction · 0.85
ParseJSONMethod · 0.80

Tested by

no test coverage detected