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
c14f71c7
Commit
c14f71c7
authored
Nov 02, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: update for error
R=golang-dev, iant, r CC=golang-dev
https://golang.org/cl/5306075
parent
e67d3c44
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
error.go
src/pkg/runtime/error.go
+5
-3
No files found.
src/pkg/runtime/error.go
View file @
c14f71c7
...
@@ -6,7 +6,7 @@ package runtime
...
@@ -6,7 +6,7 @@ package runtime
// The Error interface identifies a run time error.
// The Error interface identifies a run time error.
type
Error
interface
{
type
Error
interface
{
String
()
string
error
// RuntimeError is a no-op function but
// RuntimeError is a no-op function but
// serves to distinguish types that are runtime
// serves to distinguish types that are runtime
...
@@ -28,7 +28,7 @@ type TypeAssertionError struct {
...
@@ -28,7 +28,7 @@ type TypeAssertionError struct {
func
(
*
TypeAssertionError
)
RuntimeError
()
{}
func
(
*
TypeAssertionError
)
RuntimeError
()
{}
func
(
e
*
TypeAssertionError
)
String
()
string
{
func
(
e
*
TypeAssertionError
)
Error
()
string
{
inter
:=
e
.
interfaceString
inter
:=
e
.
interfaceString
if
inter
==
""
{
if
inter
==
""
{
inter
=
"interface"
inter
=
"interface"
...
@@ -98,7 +98,7 @@ type errorString string
...
@@ -98,7 +98,7 @@ type errorString string
func
(
e
errorString
)
RuntimeError
()
{}
func
(
e
errorString
)
RuntimeError
()
{}
func
(
e
errorString
)
String
()
string
{
func
(
e
errorString
)
Error
()
string
{
return
"runtime error: "
+
string
(
e
)
return
"runtime error: "
+
string
(
e
)
}
}
...
@@ -123,6 +123,8 @@ func printany(i interface{}) {
...
@@ -123,6 +123,8 @@ func printany(i interface{}) {
print
(
"nil"
)
print
(
"nil"
)
case
stringer
:
case
stringer
:
print
(
v
.
String
())
print
(
v
.
String
())
case
error
:
print
(
v
.
Error
())
case
int
:
case
int
:
print
(
v
)
print
(
v
)
case
string
:
case
string
:
...
...
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