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