mirror of
https://github.com/rclone/rclone
synced 2024-11-29 07:55:12 +01:00
Fix errors discovered with go vet nilness tool
This commit is contained in:
parent
2728948fb0
commit
0d475958c7
@ -708,9 +708,7 @@ func (f *Fs) List(dir string) (entries fs.DirEntries, err error) {
|
|||||||
id := info.GetID()
|
id := info.GetID()
|
||||||
f.dirCache.Put(remote, id)
|
f.dirCache.Put(remote, id)
|
||||||
d := fs.NewDir(remote, time.Time(info.GetLastModifiedDateTime())).SetID(id)
|
d := fs.NewDir(remote, time.Time(info.GetLastModifiedDateTime())).SetID(id)
|
||||||
if folder != nil {
|
|
||||||
d.SetItems(folder.ChildCount)
|
d.SetItems(folder.ChildCount)
|
||||||
}
|
|
||||||
entries = append(entries, d)
|
entries = append(entries, d)
|
||||||
} else {
|
} else {
|
||||||
o, err := f.newObjectWithInfo(remote, info)
|
o, err := f.newObjectWithInfo(remote, info)
|
||||||
@ -824,9 +822,6 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f.dirCache.FlushDir(dir)
|
f.dirCache.FlushDir(dir)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,9 +287,6 @@ func (f *Fs) purgeCheck(dir string, check bool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f.dirCache.FlushDir(dir)
|
f.dirCache.FlushDir(dir)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,8 +188,8 @@ func rcJobStatus(in Params) (out Params, err error) {
|
|||||||
defer job.mu.Unlock()
|
defer job.mu.Unlock()
|
||||||
out = make(Params)
|
out = make(Params)
|
||||||
err = Reshape(&out, job)
|
err = Reshape(&out, job)
|
||||||
if job == nil {
|
if err != nil {
|
||||||
return nil, errors.New("Reshape failed in job status")
|
return nil, errors.Wrap(err, "reshape failed in job status")
|
||||||
}
|
}
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user