Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
1dd0319b
Commit
1dd0319b
authored
Oct 22, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: print unknown types in panic
R=r CC=golang-dev
https://golang.org/cl/2683041
parent
e5e92110
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
error.go
src/pkg/runtime/error.go
+3
-1
print.c
src/pkg/runtime/print.c
+8
-0
No files found.
src/pkg/runtime/error.go
View file @
1dd0319b
...
...
@@ -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
)
}
}
src/pkg/runtime/print.c
View file @
1dd0319b
...
...
@@ -348,3 +348,11 @@ void
{
write
(
fd
,
"
\n
"
,
1
);
}
void
·
typestring
(
Eface
e
,
String
s
)
{
s
=
*
e
.
type
->
string
;
FLUSH
(
&
s
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment