(src []byte)
| 591 | } |
| 592 | |
| 593 | func (a *BytesArray) scanBytes(src []byte) error { |
| 594 | elems, err := scanLinearArray(src, []byte{','}, "BytesArray") |
| 595 | if err != nil { |
| 596 | return err |
| 597 | } |
| 598 | if *a != nil && len(elems) == 0 { |
| 599 | *a = (*a)[:0] |
| 600 | } else { |
| 601 | b := make(BytesArray, len(elems)) |
| 602 | for i, v := range elems { |
| 603 | b[i], err = parseBytea(v) |
| 604 | if err != nil { |
| 605 | return fmt.Errorf("could not parse bytea array index %d: %s", i, err.Error()) |
| 606 | } |
| 607 | } |
| 608 | *a = b |
| 609 | } |
| 610 | return nil |
| 611 | } |
| 612 | |
| 613 | // Value implements the driver.Valuer interface. It uses the "hex" format which |
| 614 | // is only supported on PostgreSQL 9.0 or newer. |
no test coverage detected