MCPcopy
hub / github.com/jackc/pgx / Scan

Method Scan

pgtype/xml.go:159–178  ·  view source on GitHub ↗
(src []byte, dst any)

Source from the content-addressed store, hash-verified

157}
158
159func (s *scanPlanXMLToXMLUnmarshal) Scan(src []byte, dst any) error {
160 if src == nil {
161 dstValue := reflect.ValueOf(dst)
162 if dstValue.Kind() == reflect.Pointer {
163 el := dstValue.Elem()
164 switch el.Kind() {
165 case reflect.Pointer, reflect.Slice, reflect.Map, reflect.Interface, reflect.Struct:
166 el.Set(reflect.Zero(el.Type()))
167 return nil
168 }
169 }
170
171 return fmt.Errorf("cannot scan NULL into %T", dst)
172 }
173
174 elem := reflect.ValueOf(dst).Elem()
175 elem.Set(reflect.Zero(elem.Type()))
176
177 return s.unmarshal(src, dst)
178}
179
180func (c *XMLCodec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, src []byte) (driver.Value, error) {
181 if src == nil {

Callers

nothing calls this directly

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected