MCPcopy Index your code
hub / github.com/aarondl/sqlboiler / scanBytes

Method scanBytes

types/array.go:957–974  ·  view source on GitHub ↗
(src []byte)

Source from the content-addressed store, hash-verified

955}
956
957func (a *StringArray) scanBytes(src []byte) error {
958 elems, err := scanLinearArray(src, []byte{','}, "StringArray")
959 if err != nil {
960 return err
961 }
962 if *a != nil && len(elems) == 0 {
963 *a = (*a)[:0]
964 } else {
965 b := make(StringArray, len(elems))
966 for i, v := range elems {
967 if b[i] = string(v); v == nil {
968 return fmt.Errorf("boil: parsing array element index %d: cannot convert nil to string", i)
969 }
970 }
971 *a = b
972 }
973 return nil
974}
975
976// Value implements the driver.Valuer interface.
977func (a StringArray) Value() (driver.Value, error) {

Callers 1

ScanMethod · 0.95

Calls 1

scanLinearArrayFunction · 0.85

Tested by

no test coverage detected