in pkg/transform_append_block_body.go [40:51]
func (u *AppendBlockBodyTransform) PatchWriteBlock(dest terraform.Block, patch *hclwrite.Body) {
// we cannot patch one-line block
if dest.Range().Start.Line == dest.Range().End.Line {
dest.WriteBody().AppendNewline()
}
for name, attr := range patch.Attributes() {
dest.SetAttributeRaw(name, attr.Expr().BuildTokens(nil))
}
for _, nb := range patch.Blocks() {
dest.AppendBlock(nb)
}
}