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

Method Scan

array.go:154–166  ·  view source on GitHub ↗

Scan implements the sql.Scanner interface.

(src any)

Source from the content-addressed store, hash-verified

152
153// Scan implements the sql.Scanner interface.
154func (a *ByteaArray) Scan(src any) error {
155 switch src := src.(type) {
156 case []byte:
157 return a.scanBytes(src)
158 case string:
159 return a.scanBytes([]byte(src))
160 case nil:
161 *a = nil
162 return nil
163 }
164
165 return fmt.Errorf("pq: cannot convert %T to ByteaArray", src)
166}
167
168func (a *ByteaArray) scanBytes(src []byte) error {
169 elems, err := scanLinearArray(src, []byte{','}, "ByteaArray")

Callers

nothing calls this directly

Calls 1

scanBytesMethod · 0.95

Tested by

no test coverage detected