diff --git a/validator.go b/validator.go index 020d3c8..186111e 100644 --- a/validator.go +++ b/validator.go @@ -244,8 +244,10 @@ func (v *Validate) structRecursive(top interface{}, current interface{}, s inter var structName string var numFields int + var cs *cachedStruct + var isCached bool - cs, isCached := structCache.Get(structType) + cs, isCached = structCache.Get(structType) if isCached { structName = cs.name