From ecc1f9278749dcc23519c572e41a0554a9a92878 Mon Sep 17 00:00:00 2001 From: Justin Clift Date: Tue, 25 Oct 2016 18:10:53 +0100 Subject: [PATCH] Remove redundant check of error var e As per #649 --- src/restic/backend/local/local.go | 2 +- src/restic/backend/sftp/sftp.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/restic/backend/local/local.go b/src/restic/backend/local/local.go index 98172af89..4af960e51 100644 --- a/src/restic/backend/local/local.go +++ b/src/restic/backend/local/local.go @@ -118,7 +118,7 @@ func (b *Local) Load(h restic.Handle, p []byte, off int64) (n int, err error) { defer func() { e := f.Close() - if err == nil && e != nil { + if err == nil { err = errors.Wrap(e, "Close") } }() diff --git a/src/restic/backend/sftp/sftp.go b/src/restic/backend/sftp/sftp.go index 2809dc676..95555441f 100644 --- a/src/restic/backend/sftp/sftp.go +++ b/src/restic/backend/sftp/sftp.go @@ -345,7 +345,7 @@ func (r *SFTP) Load(h restic.Handle, p []byte, off int64) (n int, err error) { defer func() { e := f.Close() - if err == nil && e != nil { + if err == nil { err = errors.Wrap(e, "Close") } }()