diff --git a/internal/command/migrate/migrations_terraform.go b/internal/command/migrate/migrations_terraform.go index 3a6c3e2b6b..afbb5f06ff 100644 --- a/internal/command/migrate/migrations_terraform.go +++ b/internal/command/migrate/migrations_terraform.go @@ -6,6 +6,7 @@ package migrate import ( "fmt" "regexp" + "strings" ) func terraformMigrations() []Migration { @@ -123,14 +124,9 @@ func splitLines(s string) []string { } func joinLines(lines []string) string { - result := "" - for _, line := range lines { - result += "\n" + line - } - return result + return "\n" + strings.Join(lines, "\n") } - var backendRemoteBlockRe = regexp.MustCompile(`(?s)([ \t]*)backend\s+"remote"\s*\{`) func applyBackendToCloud(_ string, src []byte) ([]byte, error) {