Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
src/pkg/runtime/error.go
src/pkg/runtime/error.go
+3
-1
src/pkg/runtime/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