Update reflect2 to 1.0.1 (memory utilization fix)

Picking up https://github.com/modern-go/reflect2/pull/2 which lazy
initializes a map of all types which we don't use in k8s, saving
memory & initialization time.
This commit is contained in:
Justin Santa Barbara
2018-09-04 13:13:00 -04:00
committed by Justin Santa Barbara
parent 674401ace1
commit 970e4da4c6
18 changed files with 33 additions and 19 deletions

View File

@@ -150,6 +150,9 @@ func (cfg *frozenConfig) TypeOf(obj interface{}) Type {
}
func (cfg *frozenConfig) Type2(type1 reflect.Type) Type {
if type1 == nil {
return nil
}
cacheKey := uintptr(unpackEFace(type1).data)
typeObj, found := cfg.cache.Load(cacheKey)
if found {