]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix for go<1.16
authorMatt Joiner <anacrolix@gmail.com>
Mon, 1 Feb 2021 05:55:22 +0000 (16:55 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 1 Feb 2021 23:41:39 +0000 (10:41 +1100)
storage/piece_resource.go

index 43f98da70cd237d75fd55fc07f09db00fa7fa7a1..c723831fd3e0626e23589f489fa377a26346606b 100644 (file)
@@ -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)