Update utils.go

This commit is contained in:
systematiccaos 2021-12-27 12:30:50 +01:00 committed by GitHub
parent 2c3fc2db28
commit c460860d34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,12 @@ func GetIdentityFieldValuesMap(reflectValue reflect.Value, fields []*Field) (map
loaded = map[interface{}]bool{} loaded = map[interface{}]bool{}
notZero, zero bool notZero, zero bool
) )
if reflectValue.Kind() == reflect.Interface {
reflectValue = reflectValue.Elem()
if reflectValue.Kind() == reflect.Ptr {
reflectValue = reflectValue.Elem()
}
}
switch reflectValue.Kind() { switch reflectValue.Kind() {
case reflect.Struct: case reflect.Struct:
results = [][]interface{}{make([]interface{}, len(fields))} results = [][]interface{}{make([]interface{}, len(fields))}