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
1fc094e0
Commit
1fc094e0
authored
Jun 22, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
explicitly throw away impossible write errors
parent
1e80322c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
codec.go
codec.go
+2
-2
No files found.
codec.go
View file @
1fc094e0
...
...
@@ -26,7 +26,7 @@ func stringToBytes(s string) ([]byte, error) {
if
p
.
Code
==
0
{
return
nil
,
fmt
.
Errorf
(
"no protocol with name %s"
,
sp
[
0
])
}
b
.
Write
(
CodeToVarint
(
p
.
Code
))
_
,
_
=
b
.
Write
(
CodeToVarint
(
p
.
Code
))
sp
=
sp
[
1
:
]
if
p
.
Size
==
0
{
// no length.
...
...
@@ -51,7 +51,7 @@ func stringToBytes(s string) ([]byte, error) {
return
nil
,
fmt
.
Errorf
(
"failed to parse %s: %s %s"
,
p
.
Name
,
sp
[
0
],
err
)
}
if
p
.
Size
<
0
{
// varint size.
b
.
Write
(
CodeToVarint
(
len
(
a
)))
_
,
_
=
b
.
Write
(
CodeToVarint
(
len
(
a
)))
}
b
.
Write
(
a
)
sp
=
sp
[
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