aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/error.go')
-rw-r--r--src/runtime/error.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/runtime/error.go b/src/runtime/error.go
index 6048272e75..e1291e1543 100644
--- a/src/runtime/error.go
+++ b/src/runtime/error.go
@@ -73,14 +73,12 @@ func typestring(x interface{}) string {
}
// printany prints an argument passed to panic.
+// If panic is called with a value that has a String or Error method,
+// it has already been converted into a string by preprintpanics.
func printany(i interface{}) {
switch v := i.(type) {
case nil:
print("nil")
- case stringer:
- print(v.String())
- case error:
- print(v.Error())
case bool:
print(v)
case int: