optimization code

pull/787/head
qm012 3 years ago
parent c0d60f020b
commit 8f8659b3a4
  1. 3
      cache.go

@ -165,8 +165,7 @@ func (v *Validate) extractStructCache(current reflect.Value, sName string) *cStr
} }
// The priority of RegisterTagNameFunc is higher than the custom tag value // The priority of RegisterTagNameFunc is higher than the custom tag value
if v.hasTagNameFunc { if v.hasTagNameFunc {
value := v.tagNameFunc(fld) if value := v.tagNameFunc(fld); len(value) != 0 {
if len(value) != 0 {
tagValues[defaultErrTagName] = value tagValues[defaultErrTagName] = value
} }
} }

Loading…
Cancel
Save