1
mirror of https://github.com/rclone/rclone synced 2024-11-26 04:07:22 +01:00

Fix errors discovered with go vet nilness tool

This commit is contained in:
Nick Craig-Wood 2019-03-18 11:23:00 +00:00
parent 2728948fb0
commit 0d475958c7
3 changed files with 3 additions and 11 deletions

View File

@ -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
} }

View File

@ -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
} }

View File

@ -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
} }