MCPcopy Create free account
hub / github.com/devfeel/mapper / CheckExistsField

Method CheckExistsField

mapper_object.go:360–370  ·  view source on GitHub ↗

CheckExistsField check field is exists by name

(elem reflect.Value, fieldName string)

Source from the content-addressed store, hash-verified

358
359// CheckExistsField check field is exists by name
360func (dm *mapperObject) CheckExistsField(elem reflect.Value, fieldName string) (realFieldName string, exists bool) {
361 typeName := elem.Type().String()
362 fileKey := typeName + nameConnector + fieldName
363 realName, isOk := dm.fieldNameMap.Load(fileKey)
364
365 if !isOk {
366 return "", isOk
367 } else {
368 return realName.(string), isOk
369 }
370}
371
372// CheckIsTypeWrapper check value is in type wrappers
373func (dm *mapperObject) CheckIsTypeWrapper(value reflect.Value) bool {

Callers 2

MapperMapMethod · 0.95

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected