From 77ff15ee33be54a36f0a36054220ad902c1622c2 Mon Sep 17 00:00:00 2001 From: ysqi Date: Thu, 5 May 2016 19:26:03 +0800 Subject: [PATCH] Implement Error interface for validation error --- validation/validation.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/validation/validation.go b/validation/validation.go index 2b020aa8..489dfa5e 100644 --- a/validation/validation.go +++ b/validation/validation.go @@ -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 {