diff options
Diffstat (limited to 'formats/packfile/common.go')
-rw-r--r-- | formats/packfile/common.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/formats/packfile/common.go b/formats/packfile/common.go index 06c63d4..57bc0b9 100644 --- a/formats/packfile/common.go +++ b/formats/packfile/common.go @@ -1,6 +1,7 @@ package packfile import ( + "bufio" "fmt" "io" ) @@ -10,6 +11,12 @@ type trackingReader struct { position int64 } +func NewTrackingReader(r io.Reader) *trackingReader { + return &trackingReader{ + r: bufio.NewReader(r), + } +} + func (t *trackingReader) Read(p []byte) (n int, err error) { n, err = t.r.Read(p) if err != nil { |