Fix for go<1.16

This commit is contained in:
Matt Joiner 2021-02-01 16:55:22 +11:00
parent 15ccbc95c6
commit 48843c0b87
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"path" "path"
"sort" "sort"
"strconv" "strconv"
@ -121,7 +122,7 @@ func (s piecePerResourcePiece) MarkComplete() error {
if ccr, ok := s.rp.(ConsecutiveChunkReader); ok { if ccr, ok := s.rp.(ConsecutiveChunkReader); ok {
return ccr.ReadConsecutiveChunks(s.incompleteDirPath() + "/") 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 { if err != nil {
return fmt.Errorf("getting incomplete chunks reader: %w", err) return fmt.Errorf("getting incomplete chunks reader: %w", err)