Skip to content

Commit

Permalink
added one of as example
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash Jagdale committed Jul 29, 2023
1 parent bd1113d commit 910558b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _examples/simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type User struct {
LastName string `validate:"required"`
Age uint8 `validate:"gte=0,lte=130"`
Email string `validate:"required,email"`
Gender string `validate:"oneof=male female prefer_not_to`
FavouriteColor string `validate:"iscolor"` // alias for 'hexcolor|rgb|rgba|hsl|hsla'
Addresses []*Address `validate:"required,dive,required"` // a person can have a home and cottage...
}
Expand Down Expand Up @@ -47,6 +48,7 @@ func validateStruct() {
FirstName: "Badger",
LastName: "Smith",
Age: 135,
Gender: "male",
Email: "Badger.Smith@gmail.com",
FavouriteColor: "#000-",
Addresses: []*Address{address},
Expand Down

0 comments on commit 910558b

Please sign in to comment.