http: fix race introduced in 7982aaf151

This commit is contained in:
Nick Craig-Wood 2019-09-14 08:48:13 +01:00
parent 3b68340eac
commit 1a16849df0

View File

@ -456,7 +456,7 @@ func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err e
fs: f, fs: f,
remote: remote, remote: remote,
} }
switch err = file.stat(ctx); err { switch err := file.stat(ctx); err {
case nil: case nil:
add(file) add(file)
case fs.ErrorNotAFile: case fs.ErrorNotAFile: