From 9653a4aad4bed727a828034c0ed5c371aada90af Mon Sep 17 00:00:00 2001 From: Syfaro Date: Fri, 29 Dec 2017 21:55:58 -0600 Subject: [PATCH] Handle some ignored errors. --- bot.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bot.go b/bot.go index 7985fc7..63fb3e0 100644 --- a/bot.go +++ b/bot.go @@ -217,9 +217,9 @@ func (bot *BotAPI) GetMe() (User, error) { } var user User - json.Unmarshal(resp.Result, &user) + err = json.Unmarshal(resp.Result, &user) - return user, nil + return user, err } // IsMessageToMe returns true if message directed to this bot. @@ -292,9 +292,9 @@ func (bot *BotAPI) GetUserProfilePhotos(config UserProfilePhotosConfig) (UserPro } var profilePhotos UserProfilePhotos - json.Unmarshal(resp.Result, &profilePhotos) + err = json.Unmarshal(resp.Result, &profilePhotos) - return profilePhotos, nil + return profilePhotos, err } // GetFile returns a File which can download a file from Telegram. @@ -310,9 +310,9 @@ func (bot *BotAPI) GetFile(config FileConfig) (File, error) { } var file File - json.Unmarshal(resp.Result, &file) + err = json.Unmarshal(resp.Result, &file) - return file, nil + return file, err } // GetUpdates fetches updates. @@ -340,9 +340,9 @@ func (bot *BotAPI) GetUpdates(config UpdateConfig) ([]Update, error) { } var updates []Update - json.Unmarshal(resp.Result, &updates) + err = json.Unmarshal(resp.Result, &updates) - return updates, nil + return updates, err } // GetWebhookInfo allows you to fetch information about a webhook and if