Fix duplicate import under different aliases
This commit is contained in:
parent
fdfd305a0c
commit
d56087441e
|
@ -2,7 +2,6 @@ package torrentfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
netContext "context"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
@ -202,9 +201,9 @@ func TestDownloadOnDemand(t *testing.T) {
|
||||||
fs := New(leecher)
|
fs := New(leecher)
|
||||||
defer fs.Destroy()
|
defer fs.Destroy()
|
||||||
root, _ := fs.Root()
|
root, _ := fs.Root()
|
||||||
node, _ := root.(fusefs.NodeStringLookuper).Lookup(netContext.Background(), "greeting")
|
node, _ := root.(fusefs.NodeStringLookuper).Lookup(context.Background(), "greeting")
|
||||||
var attr fuse.Attr
|
var attr fuse.Attr
|
||||||
node.Attr(netContext.Background(), &attr)
|
node.Attr(context.Background(), &attr)
|
||||||
size := attr.Size
|
size := attr.Size
|
||||||
data := make([]byte, size)
|
data := make([]byte, size)
|
||||||
h, err := node.(fusefs.NodeOpener).Open(context.TODO(), nil, nil)
|
h, err := node.(fusefs.NodeOpener).Open(context.TODO(), nil, nil)
|
||||||
|
@ -215,7 +214,7 @@ func TestDownloadOnDemand(t *testing.T) {
|
||||||
var n int
|
var n int
|
||||||
for n < len(data) {
|
for n < len(data) {
|
||||||
resp := fuse.ReadResponse{Data: data[n:]}
|
resp := fuse.ReadResponse{Data: data[n:]}
|
||||||
err := h.(fusefs.HandleReader).Read(netContext.Background(), &fuse.ReadRequest{
|
err := h.(fusefs.HandleReader).Read(context.Background(), &fuse.ReadRequest{
|
||||||
Size: int(size) - n,
|
Size: int(size) - n,
|
||||||
Offset: int64(n),
|
Offset: int64(n),
|
||||||
}, &resp)
|
}, &resp)
|
||||||
|
|
Loading…
Reference in New Issue