fix schema GetIdentityFieldValuesMap interface or ptr (#6417)

Co-authored-by: uptutu <yitao.gong@vzenith.com>
This commit is contained in:
龚一涛 2023-08-19 21:35:14 +08:00 committed by GitHub
parent 2c2089760c
commit 7e44f73ad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -115,6 +115,11 @@ func GetIdentityFieldValuesMap(ctx context.Context, reflectValue reflect.Value,
notZero, zero bool
)
if reflectValue.Kind() == reflect.Ptr ||
reflectValue.Kind() == reflect.Interface {
reflectValue = reflectValue.Elem()
}
switch reflectValue.Kind() {
case reflect.Struct:
results = [][]interface{}{make([]interface{}, len(fields))}