From: Matt Joiner Date: Mon, 1 Feb 2021 05:55:22 +0000 (+1100) Subject: Fix for go<1.16 X-Git-Tag: v1.23.0~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=48843c0b87faf334ce4663a2ce39859e24d7b8d8;p=btrtrc.git Fix for go<1.16 --- 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)