buffer errTag + errs array.

pull/256/head
joeybloggs 8 years ago
parent 5d28ac67f7
commit 5fedd8c08a
  1. 9
      validator.go
  2. 1
      validator_instance.go

@ -226,7 +226,7 @@ OUTER:
case typeOr:
errTag := ""
errTag := make([]byte, 0, 64)
for {
@ -252,7 +252,8 @@ OUTER:
}
}
errTag += orSeparator + ct.tag
errTag = append(errTag, '|')
errTag = append(errTag, ct.tag...)
if ct.next == nil {
// if we get here, no valid 'or' value and no more tags
@ -278,8 +279,8 @@ OUTER:
v.errs = append(v.errs,
&fieldError{
tag: errTag[1:],
actualTag: errTag[1:],
tag: string(errTag)[1:],
actualTag: string(errTag)[1:],
ns: string(append(ns, cf.AltName...)),
structNs: string(append(structNs, cf.Name...)),
field: cf.AltName,

@ -90,6 +90,7 @@ func New() *Validate {
New: func() interface{} {
return &validate{
v: v,
errs: make(ValidationErrors, 0, 4),
}
},
}

Loading…
Cancel
Save