Remove unnecessary error check.
Cameron Stitt
6 years ago
43 | 43 |
default:
|
44 | 44 |
key = fmt.Sprint(x)
|
45 | 45 |
}
|
46 | |
if x, ok := v.(error); ok {
|
47 | |
v = safeError(x)
|
48 | |
}
|
49 | 46 |
|
50 | 47 |
// We want json.Marshaler and encoding.TextMarshaller to take priority over
|
51 | 48 |
// err.Error() and v.String(). But json.Marshall (called later) does that by
|
87 | 87 |
return "string"
|
88 | 88 |
}
|
89 | 89 |
|
|
90 |
func (aller) Error() string {
|
|
91 |
return "error"
|
|
92 |
}
|
|
93 |
|
90 | 94 |
// textstringer implements encoding.TextMarshaler and fmt.Stringer.
|
91 | 95 |
type textstringer struct{}
|
92 | 96 |
|