X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=example_test.go;h=54cb7190689081ac8020a24aeca054897a79ce13;hb=HEAD;hp=002f507d28a89edcc74f92365032de1e873397ef;hpb=9f94ca79c1a25c10edeb5be96d8ce1ea4b9f1c9b;p=btrtrc.git diff --git a/example_test.go b/example_test.go index 002f507d..54cb7190 100644 --- a/example_test.go +++ b/example_test.go @@ -1,7 +1,6 @@ package torrent_test import ( - "io" "log" "github.com/anacrolix/torrent" @@ -18,12 +17,9 @@ func Example() { } func Example_fileReader() { - var ( - t torrent.Torrent - f torrent.File - ) - r := t.NewReader() + var f torrent.File + // Accesses the parts of the torrent pertaining to f. Data will be + // downloaded as required, per the configuration of the torrent.Reader. + r := f.NewReader() defer r.Close() - _ = io.NewSectionReader(r, f.Offset(), f.Length()) - // fr will read from the parts of the torrent pertaining to f. }