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
56579399
Commit
56579399
authored
Oct 18, 2011
by
Andrey Mirtchovski
Committed by
Russ Cox
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: remove duplicate error information in Dial
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5293045
parent
48bb3e8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
dial.go
src/pkg/net/dial.go
+2
-2
net_test.go
src/pkg/net/net_test.go
+6
-0
No files found.
src/pkg/net/dial.go
View file @
56579399
...
...
@@ -59,10 +59,10 @@ func Dial(net, addr string) (c Conn, err os.Error) {
case
*
IPAddr
:
c
,
err
=
DialIP
(
net
,
nil
,
ra
)
default
:
err
=
UnknownNetworkError
(
net
)
err
=
&
OpError
{
"dial"
,
net
+
" "
+
addr
,
nil
,
UnknownNetworkError
(
net
)}
}
if
err
!=
nil
{
return
nil
,
&
OpError
{
"dial"
,
net
+
" "
+
addr
,
nil
,
err
}
return
nil
,
err
}
return
}
...
...
src/pkg/net/net_test.go
View file @
56579399
...
...
@@ -62,6 +62,8 @@ var dialErrorTests = []DialErrorTest{
},
}
var
duplicateErrorPattern
=
`dial (.*) dial (.*)`
func
TestDialError
(
t
*
testing
.
T
)
{
if
!*
runErrorTest
{
t
.
Logf
(
"test disabled; use --run_error_test to enable"
)
...
...
@@ -81,6 +83,10 @@ func TestDialError(t *testing.T) {
if
!
match
{
t
.
Errorf
(
"#%d: %q, want match for %#q"
,
i
,
s
,
tt
.
Pattern
)
}
match
,
_
=
regexp
.
MatchString
(
duplicateErrorPattern
,
s
)
if
match
{
t
.
Errorf
(
"#%d: %q, duplicate error return from Dial"
,
i
,
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