mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-07 04:15:11 +00:00
fix(spectypes): correct quoting logic in formatPostgresStringArray
This commit is contained in:
@@ -66,7 +66,7 @@ func formatPostgresStringArray(vals []string) string {
|
||||
parts := make([]string, len(vals))
|
||||
for i, v := range vals {
|
||||
// Quote if value contains comma, double-quote, backslash, braces, whitespace, or is empty.
|
||||
needsQuote := v == "" || strings.ContainsAny(v, `,"\\{}` + "\t\n\r ")
|
||||
needsQuote := v == "" || strings.ContainsAny(v, `,"\\{}`+"\t\n\r ")
|
||||
if needsQuote {
|
||||
v = strings.ReplaceAll(v, `\`, `\\`)
|
||||
v = strings.ReplaceAll(v, `"`, `""`)
|
||||
|
||||
Reference in New Issue
Block a user