improved: dataStruct's type equals interface

This commit is contained in:
Henry Huang 2016-01-21 15:44:47 +08:00
parent 85579d38ad
commit 41d16df21c
1 changed files with 3 additions and 0 deletions

View File

@ -124,6 +124,9 @@ func (col *Column) ValueOfV(dataStruct *reflect.Value) (*reflect.Value, error) {
keyValue := reflect.ValueOf(col.fieldPath[len(col.fieldPath)-1])
fieldValue = dataStruct.MapIndex(keyValue)
return &fieldValue, nil
} else if dataStruct.Type().Kind() == reflect.Interface {
structValue := reflect.ValueOf(dataStruct.Interface())
dataStruct = &structValue
}
level := len(col.fieldPath)