MCPcopy Index your code
hub / github.com/lib/pq / scanBytes

Method scanBytes

array.go:522–540  ·  view source on GitHub ↗
(src []byte)

Source from the content-addressed store, hash-verified

520}
521
522func (a *Int64Array) scanBytes(src []byte) error {
523 elems, err := scanLinearArray(src, []byte{','}, "Int64Array")
524 if err != nil {
525 return err
526 }
527 if *a != nil && len(elems) == 0 {
528 *a = (*a)[:0]
529 } else {
530 b := make(Int64Array, len(elems))
531 for i, v := range elems {
532 b[i], err = strconv.ParseInt(string(v), 10, 64)
533 if err != nil {
534 return fmt.Errorf("pq: parsing array element index %d: %w", i, err)
535 }
536 }
537 *a = b
538 }
539 return nil
540}
541
542// Value implements the driver.Valuer interface.
543func (a Int64Array) Value() (driver.Value, error) {

Callers 1

ScanMethod · 0.95

Calls 1

scanLinearArrayFunction · 0.85

Tested by

no test coverage detected