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
64f78c91
Commit
64f78c91
authored
Oct 27, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: error-related fixes
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/5328051
parent
29fb5d3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
11 deletions
+7
-11
test/fixedbugs/bug365.go
test/fixedbugs/bug365.go
+2
-2
test/import.go
test/import.go
+3
-4
test/zerodivide.go
test/zerodivide.go
+2
-5
No files found.
test/fixedbugs/bug365.go
View file @
64f78c91
...
...
@@ -12,11 +12,11 @@
package
main
type
S
struct
{
err
os
.
Error
// ERROR "undefined|expected package"
err
foo
.
Bar
// ERROR "undefined|expected package"
Num
int
}
func
main
()
{
s
:=
S
{}
_
=
s
.
Num
// no error here please
_
=
s
.
Num
// no error here please
}
test/import.go
View file @
64f78c91
...
...
@@ -13,13 +13,12 @@ import _os_ "os"
import
"os"
import
.
"os"
func
f
(
e
os
.
Error
)
func
f
(
e
*
os
.
File
)
func
main
()
{
var
_e_
_os_
.
Error
var
dot
Error
var
_e_
*
_os_
.
File
var
dot
*
File
f
(
_e_
)
f
(
dot
)
}
test/zerodivide.go
View file @
64f78c91
...
...
@@ -9,13 +9,10 @@ package main
import
(
"fmt"
"math"
"runtime"
"strings"
)
type
Error
interface
{
String
()
string
}
type
ErrorTest
struct
{
name
string
fn
func
()
...
...
@@ -164,7 +161,7 @@ var errorTests = []ErrorTest{
func
error
(
fn
func
())
(
error
string
)
{
defer
func
()
{
if
e
:=
recover
();
e
!=
nil
{
error
=
e
.
(
Error
)
.
String
()
error
=
e
.
(
runtime
.
Error
)
.
String
()
}
}()
fn
()
...
...
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