Skip to content

Commit

Permalink
Merge pull request #135 from hvnsweeting/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
asaskevich committed Jul 15, 2016
2 parents df81827 + fc087db commit 884d5bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ Here's some code to explain it:
type exampleStruct struct {
Name string ``
Email string `valid:"email"`
}

// this, however, will only fail when Email is empty or an invalid email address:
type exampleStruct2 struct {
Name string `valid:"-"`
Email string `valid:"email"`
}

// lastly, this will only fail when Email is an invalid email address but not when it's empty:
type exampleStruct2 struct {
Name string `valid:"-"`
Email string `valid:"email,optional"`
}
```

#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123))
Expand Down

0 comments on commit 884d5bd

Please sign in to comment.