WriteToBufferInCsv implements Stringer.WriteToBufferInCsv
(bf *bytes.Buffer, escapeBackslash bool, opt *csvOption)
| 306 | |
| 307 | // WriteToBufferInCsv implements Stringer.WriteToBufferInCsv |
| 308 | func (s *SQLTypeBytes) WriteToBufferInCsv(bf *bytes.Buffer, escapeBackslash bool, opt *csvOption) { |
| 309 | if s.RawBytes != nil { |
| 310 | bf.Write(opt.delimiter) |
| 311 | switch opt.binaryFormat { |
| 312 | case BinaryFormatHEX: |
| 313 | fmt.Fprintf(bf, "%x", s.RawBytes) |
| 314 | case BinaryFormatBase64: |
| 315 | bf.WriteString(base64.StdEncoding.EncodeToString(s.RawBytes)) |
| 316 | default: |
| 317 | escapeCSV(s.RawBytes, bf, escapeBackslash, opt) |
| 318 | } |
| 319 | bf.Write(opt.delimiter) |
| 320 | } else { |
| 321 | bf.WriteString(opt.nullValue) |
| 322 | } |
| 323 | } |
nothing calls this directly
no test coverage detected