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

Method MakeChild

ext/dynblock/iteration.go:48–69  ·  view source on GitHub ↗
(iteratorName string, key, value cty.Value)

Source from the content-addressed store, hash-verified

46}
47
48func (i *iteration) MakeChild(iteratorName string, key, value cty.Value) *iteration {
49 if i == nil {
50 // Create entirely new root iteration, then
51 return &iteration{
52 IteratorName: iteratorName,
53 Key: key,
54 Value: value,
55 }
56 }
57
58 inherited := map[string]*iteration{}
59 for name, otherIt := range i.Inherited {
60 inherited[name] = otherIt
61 }
62 inherited[i.IteratorName] = i
63 return &iteration{
64 IteratorName: iteratorName,
65 Key: key,
66 Value: value,
67 Inherited: inherited,
68 }
69}

Callers 2

VisitMethod · 0.80
expandBlocksMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected