all repos — telegram-bot-api @ 5e5de566ee3e664ae54f033dc6b56dcf55b58cef

Golang bindings for the Telegram Bot API

remove unneeded else block
Syfaro syfaro@foxpaw.in
Tue, 28 Jul 2015 12:19:53 -0400
commit

5e5de566ee3e664ae54f033dc6b56dcf55b58cef

parent

b0c8029a0fd78a97095333c987bcba604051f522

1 files changed, 1 insertions(+), 2 deletions(-)

jump to
M methods.gomethods.go

@@ -134,9 +134,8 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) {

resp, err := bot.Client.PostForm("https://api.telegram.org/bot"+bot.Token+"/"+endpoint, params) if err != nil { return APIResponse{}, err - } else { - defer resp.Body.Close() } + defer resp.Body.Close() bytes, err := ioutil.ReadAll(resp.Body) if err != nil {