X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=example_test.go;h=54cb7190689081ac8020a24aeca054897a79ce13;hb=1c1f47555b4d90957482df0e1e5ff67b5c8d5bf7;hp=5c58e4d93a59d91cfa351904e99e31a9c4ee662c;hpb=d3a1c79c7985f2bf973f5d6cc788a5dd067f1426;p=btrtrc.git diff --git a/example_test.go b/example_test.go index 5c58e4d9..54cb7190 100644 --- a/example_test.go +++ b/example_test.go @@ -3,8 +3,6 @@ package torrent_test import ( "log" - "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent" ) @@ -19,13 +17,9 @@ func Example() { } func Example_fileReader() { - var ( - t *torrent.Torrent - f torrent.File - ) - r := t.NewReader() - defer r.Close() - // Access the parts of the torrent pertaining to f. Data will be + 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. - _ = missinggo.NewSectionReadSeeker(r, f.Offset(), f.Length()) + r := f.NewReader() + defer r.Close() }