From 866c3293d9a76aa491e56cc978d0d7fb0e63e121 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 21 Mar 2017 09:14:48 +0900 Subject: fix breaking compatibility. revert cf4bd560f1588d96c502b4c3407fe1a10cef4a28 close #394 --- error.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'error.go') diff --git a/error.go b/error.go index be530e5..49ab890 100644 --- a/error.go +++ b/error.go @@ -58,7 +58,7 @@ var ( // Error return error message from errno. func (err ErrNo) Error() string { - return (&Error{Code: err}).Error() + return Error{Code: err}.Error() } // Extend return extended errno. @@ -68,11 +68,10 @@ func (err ErrNo) Extend(by int) ErrNoExtended { // Error return error message that is extended code. func (err ErrNoExtended) Error() string { - return (&Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}).Error() + return Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}.Error() } -// Error return error message. -func (err *Error) Error() string { +func (err Error) Error() string { if err.err != "" { return err.err } -- cgit v1.2.3