mirror of
https://github.com/golang/go
synced 2024-11-11 23:40:22 -07:00
runtime: print unknown types in panic
R=r CC=golang-dev https://golang.org/cl/2683041
This commit is contained in:
parent
e5e9211071
commit
1dd0319be3
@ -111,6 +111,8 @@ type stringer interface {
|
||||
String() string
|
||||
}
|
||||
|
||||
func typestring(interface{}) string
|
||||
|
||||
// For calling from C.
|
||||
// Prints an argument passed to panic.
|
||||
// There's room for arbitrary complexity here, but we keep it
|
||||
@ -126,6 +128,6 @@ func printany(i interface{}) {
|
||||
case string:
|
||||
print(v)
|
||||
default:
|
||||
print(i)
|
||||
print("(", typestring(i), ") ", i)
|
||||
}
|
||||
}
|
||||
|
@ -348,3 +348,11 @@ void
|
||||
{
|
||||
write(fd, "\n", 1);
|
||||
}
|
||||
|
||||
void
|
||||
·typestring(Eface e, String s)
|
||||
{
|
||||
s = *e.type->string;
|
||||
FLUSH(&s);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user