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
5e60d16f
Commit
5e60d16f
authored
Mar 30, 2021
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ineffectual assignment of error
parent
9592ea17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
multiaddr/main.go
multiaddr/main.go
+5
-5
No files found.
multiaddr/main.go
View file @
5e60d16f
...
...
@@ -36,19 +36,19 @@ Options:
addrStr
:=
flag
.
Args
()[
0
]
var
addr
maddr
.
Multiaddr
var
err
error
var
m
err
error
if
strings
.
HasPrefix
(
addrStr
,
"0x"
)
{
addrBytes
,
err
:=
hex
.
DecodeString
(
addrStr
[
2
:
])
if
err
!=
nil
{
fmt
.
Fprintf
(
os
.
Stderr
,
"parse error: %s
\n
"
,
err
)
os
.
Exit
(
1
)
}
addr
,
err
=
maddr
.
NewMultiaddrBytes
(
addrBytes
)
addr
,
m
err
=
maddr
.
NewMultiaddrBytes
(
addrBytes
)
}
else
{
addr
,
err
=
maddr
.
NewMultiaddr
(
addrStr
)
addr
,
m
err
=
maddr
.
NewMultiaddr
(
addrStr
)
}
if
err
!=
nil
{
fmt
.
Fprintf
(
os
.
Stderr
,
"parse error: %s
\n
"
,
err
)
if
m
err
!=
nil
{
fmt
.
Fprintf
(
os
.
Stderr
,
"parse error: %s
\n
"
,
m
err
)
os
.
Exit
(
1
)
}
...
...
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