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

Method scanBytes

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

Source from the content-addressed store, hash-verified

238}
239
240func (a *Float64Array) scanBytes(src []byte) error {
241 elems, err := scanLinearArray(src, []byte{','}, "Float64Array")
242 if err != nil {
243 return err
244 }
245 if *a != nil && len(elems) == 0 {
246 *a = (*a)[:0]
247 } else {
248 b := make(Float64Array, len(elems))
249 for i, v := range elems {
250 b[i], err = strconv.ParseFloat(string(v), 64)
251 if err != nil {
252 return fmt.Errorf("pq: parsing array element index %d: %w", i, err)
253 }
254 }
255 *a = b
256 }
257 return nil
258}
259
260// Value implements the driver.Valuer interface.
261func (a Float64Array) Value() (driver.Value, error) {

Callers 1

ScanMethod · 0.95

Calls 1

scanLinearArrayFunction · 0.85

Tested by

no test coverage detected