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

Method Scan

array.go:633–645  ·  view source on GitHub ↗

Scan implements the sql.Scanner interface.

(src any)

Source from the content-addressed store, hash-verified

631
632// Scan implements the sql.Scanner interface.
633func (a *StringArray) Scan(src any) error {
634 switch src := src.(type) {
635 case []byte:
636 return a.scanBytes(src)
637 case string:
638 return a.scanBytes([]byte(src))
639 case nil:
640 *a = nil
641 return nil
642 }
643
644 return fmt.Errorf("pq: cannot convert %T to StringArray", src)
645}
646
647func (a *StringArray) scanBytes(src []byte) error {
648 elems, err := scanLinearArray(src, []byte{','}, "StringArray")

Callers

nothing calls this directly

Calls 1

scanBytesMethod · 0.95

Tested by

no test coverage detected