Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
b9c1a08d
Commit
b9c1a08d
authored
Jun 18, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WrapNetConn: err on nil input
License: MIT Signed-off-by:
Juan Batiz-Benet
<
juan@benet.ai
>
parent
62d4c740
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
net.go
net.go
+3
-0
No files found.
net.go
View file @
b9c1a08d
...
@@ -26,6 +26,9 @@ type Conn interface {
...
@@ -26,6 +26,9 @@ type Conn interface {
// WrapNetConn wraps a net.Conn object with a Multiaddr
// WrapNetConn wraps a net.Conn object with a Multiaddr
// friendly Conn.
// friendly Conn.
func
WrapNetConn
(
nconn
net
.
Conn
)
(
Conn
,
error
)
{
func
WrapNetConn
(
nconn
net
.
Conn
)
(
Conn
,
error
)
{
if
nconn
==
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to convert nconn.LocalAddr: nil"
)
}
laddr
,
err
:=
FromNetAddr
(
nconn
.
LocalAddr
())
laddr
,
err
:=
FromNetAddr
(
nconn
.
LocalAddr
())
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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