From 10854957c08c8d542e2111869de01142d1526043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 1 Feb 2023 20:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=8D=E5=B0=84=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E7=9A=84=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reflect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflect.go b/reflect.go index 4d0daee..3bae95c 100644 --- a/reflect.go +++ b/reflect.go @@ -51,7 +51,6 @@ func (rt *ReflectType) Do(dataFlag string, data interface{}) *StructInfo { // 缓存存在, 直接是有缓存结果 return cacheResult } - // 缓存不存在, 解析 res := &StructInfo{ Flag: dataFlag, @@ -64,6 +63,7 @@ func (rt *ReflectType) Do(dataFlag string, data interface{}) *StructInfo { } if reflectType.Kind() != reflect.Struct { // 非结构体,无需反射 + rt.cacheTable[dataFlag] = res return res } res.IsStruct = true