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

Method fixupAttrs

ext/dynblock/unknown_body.go:92–103  ·  view source on GitHub ↗
(got hcl.Attributes)

Source from the content-addressed store, hash-verified

90}
91
92func (b unknownBody) fixupAttrs(got hcl.Attributes) hcl.Attributes {
93 if len(got) == 0 {
94 return nil
95 }
96 ret := make(hcl.Attributes, len(got))
97 for name, gotAttr := range got {
98 new := *gotAttr // shallow copy
99 new.Expr = hcl.StaticExpr(cty.DynamicVal.WithMarks(b.valueMarks), gotAttr.Expr.Range())
100 ret[name] = &new
101 }
102 return ret
103}

Callers 2

JustAttributesMethod · 0.95
fixupContentMethod · 0.95

Calls 1

RangeMethod · 0.65

Tested by

no test coverage detected