Merge pull request #64 from joeybloggs/v5-development

V5 development
pull/65/head
Dean Karn 10 years ago
commit d40121962a
  1. 2
      README.md
  2. 16
      validator.go
  3. 5
      validator_test.go

@ -11,7 +11,7 @@ Installation
Use go get.
go get -u gopkg.in/bluesuncorp/validator.v5
go get gopkg.in/bluesuncorp/validator.v5
or to update

@ -438,7 +438,7 @@ func (v *Validate) fieldWithNameAndValue(val interface{}, current interface{}, f
param := ""
if len(vals) > 1 {
param = strings.TrimSpace(vals[1])
param = vals[1]
}
cTag.keyVals[i] = []string{key, param}
@ -506,12 +506,12 @@ func (v *Validate) fieldWithNameAndSingleTag(val interface{}, current interface{
if err := valFunc(val, current, f, param); err {
return nil, nil
} else {
return &FieldError{
Field: name,
Tag: key,
Value: f,
Param: param,
}, errors.New(key)
}
return &FieldError{
Field: name,
Tag: key,
Value: f,
Param: param,
}, errors.New(key)
}

@ -276,6 +276,11 @@ func TestExcludesAllValidation(t *testing.T) {
t.Fatalf("Index: %d failed Error: %s", i, errs)
}
}
username := "joeybloggs "
err := validate.Field(username, "excludesall=@ ")
NotEqual(t, err, nil)
}
func TestExcludesValidation(t *testing.T) {

Loading…
Cancel
Save