From b019ab48c544b5429f6c2f2908a5f86f235daefb Mon Sep 17 00:00:00 2001 From: Paul Seiffert Date: Wed, 12 Jul 2017 17:33:04 +0200 Subject: [PATCH] Error is not a special case anymore --- text_formatter.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/text_formatter.go b/text_formatter.go index 6fe24fc..6aa48cf 100644 --- a/text_formatter.go +++ b/text_formatter.go @@ -169,14 +169,8 @@ func (f *TextFormatter) appendKeyValue(b *bytes.Buffer, key string, value interf } func (f *TextFormatter) appendValue(b *bytes.Buffer, value interface{}) { - var stringVal string - - switch value := value.(type) { - case string: - stringVal = value - case error: - stringVal = value.Error() - default: + stringVal, ok := value.(string) + if !ok { stringVal = fmt.Sprint(value) }