Fixes integration with "go-validate-yourself"
http://stackoverflow.com/questions/29138591/hiding-nil-values-understanding-why-golang-fails-here
This commit is contained in:
		| @ -19,5 +19,8 @@ func (_ getFormBinding) Bind(req *http.Request, obj interface{}) error { | |||||||
| 	if err := mapForm(obj, req.Form); err != nil { | 	if err := mapForm(obj, req.Form); err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	return _validator.ValidateStruct(obj) | 	if err := _validator.ValidateStruct(obj); err != nil { | ||||||
|  | 		return error(err) | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
| } | } | ||||||
|  | |||||||
| @ -21,5 +21,8 @@ func (_ jsonBinding) Bind(req *http.Request, obj interface{}) error { | |||||||
| 	if err := decoder.Decode(obj); err != nil { | 	if err := decoder.Decode(obj); err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	return _validator.ValidateStruct(obj) | 	if err := _validator.ValidateStruct(obj); err != nil { | ||||||
|  | 		return error(err) | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
| } | } | ||||||
|  | |||||||
| @ -19,5 +19,8 @@ func (_ postFormBinding) Bind(req *http.Request, obj interface{}) error { | |||||||
| 	if err := mapForm(obj, req.PostForm); err != nil { | 	if err := mapForm(obj, req.PostForm); err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	return _validator.ValidateStruct(obj) | 	if err := _validator.ValidateStruct(obj); err != nil { | ||||||
|  | 		return error(err) | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
| } | } | ||||||
|  | |||||||
| @ -20,5 +20,8 @@ func (_ xmlBinding) Bind(req *http.Request, obj interface{}) error { | |||||||
| 	if err := decoder.Decode(obj); err != nil { | 	if err := decoder.Decode(obj); err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
| 	return _validator.ValidateStruct(obj) | 	if err := _validator.ValidateStruct(obj); err != nil { | ||||||
|  | 		return error(err) | ||||||
|  | 	} | ||||||
|  | 	return nil | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user