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
f8a18bb2
Unverified
Commit
f8a18bb2
authored
Dec 14, 2018
by
Steven Allen
Committed by
GitHub
Dec 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #91 from anacrolix/fix/missing-addr-protocol-name
Use the original protocol name for address missing errors
parents
73950681
6f524a43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
codec.go
codec.go
+3
-2
No files found.
codec.go
View file @
f8a18bb2
...
...
@@ -22,7 +22,8 @@ func stringToBytes(s string) ([]byte, error) {
sp
=
sp
[
1
:
]
for
len
(
sp
)
>
0
{
p
:=
ProtocolWithName
(
sp
[
0
])
name
:=
sp
[
0
]
p
:=
ProtocolWithName
(
name
)
if
p
.
Code
==
0
{
return
nil
,
fmt
.
Errorf
(
"no protocol with name %s"
,
sp
[
0
])
}
...
...
@@ -34,7 +35,7 @@ func stringToBytes(s string) ([]byte, error) {
}
if
len
(
sp
)
<
1
{
return
nil
,
fmt
.
Errorf
(
"protocol requires address, none given: %s"
,
p
.
N
ame
)
return
nil
,
fmt
.
Errorf
(
"protocol requires address, none given: %s"
,
n
ame
)
}
if
p
.
Path
{
...
...
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