From 7e2c58b737355014fd9e0d6880ed65ca926ed971 Mon Sep 17 00:00:00 2001 From: Cameron Stitt Date: Thu, 20 Jul 2017 16:48:44 +1000 Subject: [PATCH] Remove unnecessary error check. --- log/json_logger.go | 3 --- log/json_logger_test.go | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/log/json_logger.go b/log/json_logger.go index 231e09955..66094b4dd 100644 --- a/log/json_logger.go +++ b/log/json_logger.go @@ -44,9 +44,6 @@ func merge(dst map[string]interface{}, k, v interface{}) { default: key = fmt.Sprint(x) } - if x, ok := v.(error); ok { - v = safeError(x) - } // We want json.Marshaler and encoding.TextMarshaller to take priority over // err.Error() and v.String(). But json.Marshall (called later) does that by diff --git a/log/json_logger_test.go b/log/json_logger_test.go index 00e691005..e3e309090 100644 --- a/log/json_logger_test.go +++ b/log/json_logger_test.go @@ -88,6 +88,10 @@ func (aller) String() string { return "string" } +func (aller) Error() string { + return "error" +} + // textstringer implements encoding.TextMarshaler and fmt.Stringer. type textstringer struct{}