MCPcopy Create free account
hub / github.com/golang/appengine / newStructFLS

Function newStructFLS

search/struct.go:213–223  ·  view source on GitHub ↗

newStructFLS returns a FieldLoadSaver for the struct pointer p.

(p interface{})

Source from the content-addressed store, hash-verified

211
212// newStructFLS returns a FieldLoadSaver for the struct pointer p.
213func newStructFLS(p interface{}) (FieldLoadSaver, error) {
214 v := reflect.ValueOf(p)
215 if v.Kind() != reflect.Ptr || v.IsNil() || v.Elem().Kind() != reflect.Struct {
216 return nil, ErrInvalidDocumentType
217 }
218 codec, err := loadCodec(v.Elem().Type())
219 if err != nil {
220 return nil, err
221 }
222 return structFLS{v.Elem(), codec}, nil
223}
224
225func loadStructWithMeta(dst interface{}, f []Field, meta *DocumentMetadata) error {
226 x, err := newStructFLS(dst)

Callers 2

loadStructWithMetaFunction · 0.70
saveStructWithMetaFunction · 0.70

Calls 3

loadCodecFunction · 0.70
KindMethod · 0.45
TypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…