(tag string)
| 506 | } |
| 507 | if elem == nil { |
| 508 | buf.WriteString("NULL") |
| 509 | } else { |
| 510 | s := formatTextValue(elem, elementOID) |
| 511 | // Quote strings that contain special characters |
| 512 | if needsArrayQuoting(s) { |
| 513 | buf.WriteByte('"') |
| 514 | // Escape backslashes and double quotes |
| 515 | for _, c := range s { |
| 516 | if c == '"' || c == '\\' { |
| 517 | buf.WriteByte('\\') |
| 518 | } |
| 519 | buf.WriteRune(c) |
| 520 | } |
no test coverage detected