Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamess-Lucass committed Feb 26, 2024
1 parent 7759864 commit df18ea4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ user := User{

mySchema := schema.Object(map[string]schema.ISchema{
"Firstname": schema.String().Refine(func(value string) bool {
return value == "john" || value == "doe"
return value == "john" || value == "jane"
}),
"Lastname": schema.Int().Refine(func(value int) bool {
return value == 10
"Lastname": schema.String().Refine(func(value string) bool {
return strings.Contains(value, "doe")
}),
"Age": schema.Int().Lt(10),
}).Refine(func(value map[string]interface{}) bool {
if value["Firstname"] == "doe" {
if value["Firstname"] == "jane" {
if age, ok := value["Age"].(int); ok {
return age < 5
}
Expand Down

0 comments on commit df18ea4

Please sign in to comment.