Closed
Description
Hi,
I want to validate nested maps with a mapped validate map!
example:
var mapTemplate = map[string]interface{}{
"name":"required,alpha",
"family":"required,alpha",
"email":"required,email",
"cell-phone":"numeric",
"address":map[string]interface{}{
"line1":"required,alphanum",
"line2":"alphanum",
"postal-code":"numeric",
},
}
var inputMap = map[string]interface{}{
"name":"Bob",
"family":"Smith",
"email":"[email protected]",
"address":map[string]interface{}{
"line1":"",
"line2":"",
"postal-code":"",
},
}
func validate() {
govalidator.MapValidate(mapTemplate , inputMap)
}
Activity