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
997959a3
Unverified
Commit
997959a3
authored
Jun 16, 2018
by
Steven Allen
Committed by
GitHub
Jun 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68 from mwnx/master
Two small bugfixes
parents
f36800af
b9548e77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
.travis.yml
.travis.yml
+1
-1
protocols.go
protocols.go
+2
-1
transcoders.go
transcoders.go
+1
-1
No files found.
.travis.yml
View file @
997959a3
...
...
@@ -5,7 +5,7 @@ os:
language
:
go
go
:
-
1.
8
-
1.
10.x
install
:
true
...
...
protocols.go
View file @
997959a3
...
...
@@ -4,6 +4,7 @@ import (
"encoding/binary"
"fmt"
"strings"
"math/bits"
)
// Protocol is a Multiaddr protocol description structure.
...
...
@@ -117,7 +118,7 @@ func ProtocolsWithString(s string) ([]Protocol, error) {
// CodeToVarint converts an integer to a varint-encoded []byte
func
CodeToVarint
(
num
int
)
[]
byte
{
buf
:=
make
([]
byte
,
(
num
/
7
)
+
1
)
// varint package is uint64
buf
:=
make
([]
byte
,
bits
.
Len
(
uint
(
num
))
/
7
+
1
)
n
:=
binary
.
PutUvarint
(
buf
,
uint64
(
num
))
return
buf
[
:
n
]
}
...
...
transcoders.go
View file @
997959a3
...
...
@@ -49,7 +49,7 @@ func ip4StB(s string) ([]byte, error) {
func
ip6StB
(
s
string
)
([]
byte
,
error
)
{
i
:=
net
.
ParseIP
(
s
)
.
To16
()
if
i
==
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to parse ip
4
addr: %s"
,
s
)
return
nil
,
fmt
.
Errorf
(
"failed to parse ip
6
addr: %s"
,
s
)
}
return
i
,
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