diff --git a/storage/piece_resource.go b/storage/piece_resource.go index 43f98da7..c723831f 100644 --- a/storage/piece_resource.go +++ b/storage/piece_resource.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io" + "io/ioutil" "path" "sort" "strconv" @@ -121,7 +122,7 @@ func (s piecePerResourcePiece) MarkComplete() error { if ccr, ok := s.rp.(ConsecutiveChunkReader); ok { return ccr.ReadConsecutiveChunks(s.incompleteDirPath() + "/") } - return io.NopCloser(io.NewSectionReader(incompleteChunks, 0, s.mp.Length())), nil + return ioutil.NopCloser(io.NewSectionReader(incompleteChunks, 0, s.mp.Length())), nil }() if err != nil { return fmt.Errorf("getting incomplete chunks reader: %w", err)