Error is not a special case anymore

This commit is contained in:
Paul Seiffert 2017-07-12 17:33:04 +02:00
parent 5f89343f84
commit b019ab48c5
No known key found for this signature in database
GPG Key ID: C9F76DC911D6EA29
1 changed files with 2 additions and 8 deletions

View File

@ -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)
}