Skip to content

Commit

Permalink
upgrade deps + interoperable varints. (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk authored Jul 30, 2020
1 parent bd94c78 commit ff9dcd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/multiformats/go-multistream

go 1.12

require github.com/multiformats/go-varint v0.0.6
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY=
github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE=
7 changes: 4 additions & 3 deletions multistream.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ package multistream
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"io"
"sync"

"github.com/multiformats/go-varint"
)

// ErrTooLarge is an error to signal that an incoming message was too large
Expand Down Expand Up @@ -52,7 +53,7 @@ func NewMultistreamMuxer() *MultistreamMuxer {

func writeUvarint(w io.Writer, i uint64) error {
varintbuf := make([]byte, 16)
n := binary.PutUvarint(varintbuf, i)
n := varint.PutUvarint(varintbuf, i)
_, err := w.Write(varintbuf[:n])
if err != nil {
return err
Expand Down Expand Up @@ -412,7 +413,7 @@ func lpReadBuf(r io.Reader) ([]byte, error) {
br = &byteReader{r}
}

length, err := binary.ReadUvarint(br)
length, err := varint.ReadUvarint(br)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ff9dcd5

Please sign in to comment.