This commit is contained in:
decanus 2020-02-28 15:24:00 +01:00
parent 9cac3d34b8
commit 223b9f87d0
No known key found for this signature in database
GPG Key ID: E95B8C69228FF5B4
2 changed files with 1 additions and 27 deletions

View File

@ -171,29 +171,3 @@ func sizeForAddr(p Protocol, b []byte) (skip, size int, err error) {
return n, size, nil
}
}
func bytesSplit(b []byte) ([][]byte, error) {
var ret [][]byte
for len(b) > 0 {
code, n, err := multiaddr.ReadVarintCode(b)
if err != nil {
return nil, err
}
p := ProtocolWithCode(code)
if p.Code == 0 {
return nil, fmt.Errorf("no protocol with code %d", b[0])
}
n2, size, err := sizeForAddr(p, b[n:])
if err != nil {
return nil, err
}
length := n + n2 + size
ret = append(ret, b[:length])
b = b[length:]
}
return ret, nil
}

View File

@ -9,7 +9,7 @@ import (
)
func TestMain(m *testing.M) {
multiprotocol.Init("testdata/multiprotocol.csv")
_ = multiprotocol.Init("testdata/multiprotocol.csv")
os.Exit(m.Run())
}