From 7e44f73ad3b657a86bbdc881787b03c25ab789a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=9A=E4=B8=80=E6=B6=9B?= Date: Sat, 19 Aug 2023 21:35:14 +0800 Subject: [PATCH] fix schema GetIdentityFieldValuesMap interface or ptr (#6417) Co-authored-by: uptutu --- schema/utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/schema/utils.go b/schema/utils.go index 65d012e5..7fdda185 100644 --- a/schema/utils.go +++ b/schema/utils.go @@ -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))}