(got *hcl.BodyContent)
| 75 | } |
| 76 | |
| 77 | func (b unknownBody) fixupContent(got *hcl.BodyContent) *hcl.BodyContent { |
| 78 | ret := &hcl.BodyContent{} |
| 79 | ret.Attributes = b.fixupAttrs(got.Attributes) |
| 80 | if len(got.Blocks) > 0 { |
| 81 | ret.Blocks = make(hcl.Blocks, 0, len(got.Blocks)) |
| 82 | for _, gotBlock := range got.Blocks { |
| 83 | new := *gotBlock // shallow copy |
| 84 | new.Body = unknownBody{template: gotBlock.Body, valueMarks: b.valueMarks} // nested content must also be marked unknown |
| 85 | ret.Blocks = append(ret.Blocks, &new) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return ret |
| 90 | } |
| 91 | |
| 92 | func (b unknownBody) fixupAttrs(got hcl.Attributes) hcl.Attributes { |
| 93 | if len(got) == 0 { |
no test coverage detected