From 5a3a56abd8d1749e84d386fb5af0ee5c9b1f12bc Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Tue, 19 Sep 2017 23:30:08 +0200 Subject: [PATCH] yandex: address errcheck warnings --- yandex/api/delete.go | 5 +---- yandex/api/empty_trash.go | 6 +----- yandex/api/upload.go | 6 +----- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/yandex/api/delete.go b/yandex/api/delete.go index 0159913fc..c83441115 100644 --- a/yandex/api/delete.go +++ b/yandex/api/delete.go @@ -19,8 +19,5 @@ func (c *Client) Delete(remotePath string, permanently bool) error { fullURL += urlPath } - if err := c.PerformDelete(fullURL); err != nil { - return err - } - return nil + return c.PerformDelete(fullURL) } diff --git a/yandex/api/empty_trash.go b/yandex/api/empty_trash.go index 54d97377a..65bd9b690 100644 --- a/yandex/api/empty_trash.go +++ b/yandex/api/empty_trash.go @@ -5,9 +5,5 @@ func (c *Client) EmptyTrash() error { fullURL := RootAddr fullURL += "/v1/disk/trash/resources" - if err := c.PerformDelete(fullURL); err != nil { - return err - } - - return nil + return c.PerformDelete(fullURL) } diff --git a/yandex/api/upload.go b/yandex/api/upload.go index 946e6592d..f8d3f19e1 100644 --- a/yandex/api/upload.go +++ b/yandex/api/upload.go @@ -23,11 +23,7 @@ func (c *Client) Upload(data io.Reader, remotePath string, overwrite bool, conte return err } - if err := c.PerformUpload(ur.HRef, data, contentType); err != nil { - return err - } - - return nil + return c.PerformUpload(ur.HRef, data, contentType) } // UploadRequest will make an upload request and return a URL to upload data to.