mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-02 20:57:08 +00:00
fix(spectypes): correct quoting logic in formatPostgresStringArray
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -33m2s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in -28m38s
Build , Vet Test, and Lint / Lint Code (push) Successful in -27m26s
Build , Vet Test, and Lint / Build (push) Successful in -29m3s
Tests / Integration Tests (push) Failing after -33m9s
Tests / Unit Tests (push) Successful in -30m2s
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -33m2s
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Successful in -28m38s
Build , Vet Test, and Lint / Lint Code (push) Successful in -27m26s
Build , Vet Test, and Lint / Build (push) Successful in -29m3s
Tests / Integration Tests (push) Failing after -33m9s
Tests / Unit Tests (push) Successful in -30m2s
This commit is contained in:
@@ -66,7 +66,7 @@ func formatPostgresStringArray(vals []string) string {
|
|||||||
parts := make([]string, len(vals))
|
parts := make([]string, len(vals))
|
||||||
for i, v := range vals {
|
for i, v := range vals {
|
||||||
// Quote if value contains comma, double-quote, backslash, braces, whitespace, or is empty.
|
// 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 {
|
if needsQuote {
|
||||||
v = strings.ReplaceAll(v, `\`, `\\`)
|
v = strings.ReplaceAll(v, `\`, `\\`)
|
||||||
v = strings.ReplaceAll(v, `"`, `""`)
|
v = strings.ReplaceAll(v, `"`, `""`)
|
||||||
|
|||||||
Reference in New Issue
Block a user