Skip to content

Commit 65fa29e

Browse files
committed
simplify copyAttributesSorted
1 parent 07a68c4 commit 65fa29e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

internal/convert/adv2v2.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,14 @@ func hasExpectedBlocksAsAttributes(resourceb *hclwrite.Body) bool {
188188
return false
189189
}
190190

191-
func copyAttributesSorted(targetBody *hclwrite.Body, sourceAttrs map[string]*hclwrite.Attribute,
192-
transforms ...func(string) string) {
191+
func copyAttributesSorted(targetBody *hclwrite.Body, sourceAttrs map[string]*hclwrite.Attribute) {
193192
var names []string
194193
for name := range sourceAttrs {
195194
names = append(names, name)
196195
}
197196
slices.Sort(names)
198197
for _, name := range names {
199198
expr := hcl.GetAttrExpr(sourceAttrs[name])
200-
for _, transform := range transforms {
201-
expr = transform(expr)
202-
}
203199
targetBody.SetAttributeRaw(name, hcl.TokensFromExpr(expr))
204200
}
205201
}

0 commit comments

Comments
 (0)