From 5f29f24e62f03523046d690336d3a846bae36042 Mon Sep 17 00:00:00 2001 From: David Cai Date: Wed, 31 Jan 2018 14:10:25 +0800 Subject: [PATCH] refactor: optimize cache key --- util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util.go b/util.go index 4b5f3e2..d29e11f 100644 --- a/util.go +++ b/util.go @@ -14,8 +14,8 @@ var ( func getFiledNamesByJSONKeys(obj interface{}, jsonKeys []string) (map[string]string, error) { var ( fieldNames = make(map[string]string) - structName = reflect.TypeOf(obj).Name() - fieldTagMap = map[string]string{} + fieldTagMap = make(map[string]string) + structName = reflect.TypeOf(obj).String() err error )