From 223b9f87d0c13f2ff092d0294630cd7b4ae13a6f Mon Sep 17 00:00:00 2001 From: decanus Date: Fri, 28 Feb 2020 15:24:00 +0100 Subject: [PATCH] fix --- codec.go | 26 -------------------------- multiprotocol_test.go | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/codec.go b/codec.go index 2e8c9e5..feaecbf 100644 --- a/codec.go +++ b/codec.go @@ -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 -} diff --git a/multiprotocol_test.go b/multiprotocol_test.go index 90b758a..9f9e06c 100644 --- a/multiprotocol_test.go +++ b/multiprotocol_test.go @@ -9,7 +9,7 @@ import ( ) func TestMain(m *testing.M) { - multiprotocol.Init("testdata/multiprotocol.csv") + _ = multiprotocol.Init("testdata/multiprotocol.csv") os.Exit(m.Run()) }