Implement Error interface for validation error

This commit is contained in:
ysqi 2016-05-05 19:26:03 +08:00
parent 2a2b433e19
commit 77ff15ee33
1 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,10 @@ func (e *Error) String() string {
return e.Message
}
// Implement Error interface.
// Return e.String()
func (e *Error) Error() string { return e.String() }
// Result is returned from every validation method.
// It provides an indication of success, and a pointer to the Error (if any).
type Result struct {