mirror of
https://github.com/restic/restic.git
synced 2025-12-04 01:31:48 +00:00
small cleanup:
- be explicit when discarding returned errors from .Close(), etc. - remove named return values from funcs when naked return not used - fix some "err" shadowing when redeclaration not needed
This commit is contained in:
@@ -109,7 +109,7 @@ func newLock(ctx context.Context, repo Repository, excl bool) (*Lock, error) {
|
||||
time.Sleep(waitBeforeLockCheck)
|
||||
|
||||
if err = lock.checkForOtherLocks(ctx); err != nil {
|
||||
lock.Unlock()
|
||||
_ = lock.Unlock()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ func (res *Restorer) restoreTo(ctx context.Context, dst string, dir string, tree
|
||||
debug.Log("SelectFilter returned %v %v", selectedForRestore, childMayBeSelected)
|
||||
|
||||
if selectedForRestore {
|
||||
err := res.restoreNodeTo(ctx, node, dir, dst, idx)
|
||||
err = res.restoreNodeTo(ctx, node, dir, dst, idx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -74,7 +74,8 @@ func (res *Restorer) restoreTo(ctx context.Context, dst string, dir string, tree
|
||||
if selectedForRestore {
|
||||
// Restore directory timestamp at the end. If we would do it earlier, restoring files within
|
||||
// the directory would overwrite the timestamp of the directory they are in.
|
||||
if err := node.RestoreTimestamps(filepath.Join(dst, dir, node.Name)); err != nil {
|
||||
err = node.RestoreTimestamps(filepath.Join(dst, dir, node.Name))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user