Only set namespace prefix when using FieldNameTag

pull/228/head
joeybloggs 9 years ago
parent afbcf59553
commit 0b533f264c
  1. 3
      validator.go

@ -487,8 +487,11 @@ func (v *Validate) tranverseStruct(topStruct reflect.Value, currentStruct reflec
if useStructName {
errPrefix += sName + "."
if v.fieldNameTag != "" {
nsPrefix += sName + "."
}
}
// structonly tag present don't tranverseFields
// but must still check and run below struct level validation

Loading…
Cancel
Save