Skip to content

Commit

Permalink
refactor: fix quote func (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
ginokent authored Aug 14, 2024
2 parents f347d06 + 612fe73 commit d02c17d
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 d02c17d

Please sign in to comment.