Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
refactor: fix quote func
Browse files Browse the repository at this point in the history
  • Loading branch information
ginokent committed Aug 14, 2024
1 parent 182a62a commit cd260fa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/arcgen/lang/util/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@ func JoinStringsWithQuote(ss []string, sep string, quote string) string {
return QuoteString(ss[0], quote)
}

return quote + strings.Join(ss, quote+sep+quote) + quote
var builder strings.Builder
for i, s := range ss {
if i > 0 {
builder.WriteString(sep)
}
builder.WriteString(QuoteString(s, quote))
}

return builder.String()
}

0 comments on commit cd260fa

Please sign in to comment.