Experimenting with new validation library!!!

This commit is contained in:
Manu Mtz-Almeida
2015-04-07 12:30:16 +02:00
parent ea962038e1
commit ee3b67eda1
6 changed files with 13 additions and 88 deletions

View File

@ -17,9 +17,8 @@ func (_ xmlBinding) Name() string {
func (_ xmlBinding) Bind(req *http.Request, obj interface{}) error {
decoder := xml.NewDecoder(req.Body)
if err := decoder.Decode(obj); err == nil {
return Validate(obj)
} else {
if err := decoder.Decode(obj); err != nil {
return err
}
return _validator.ValidateStruct(obj)
}