From 385be7f14c151297eb7d635eabc892a1d02a173a Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 4 May 2019 00:01:39 +0800 Subject: [PATCH] testtest --- td.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/td.go b/td.go index b6d0f50..85e9bf3 100644 --- a/td.go +++ b/td.go @@ -156,9 +156,12 @@ func getHistory(c *tdlib.Client) { MsgID64: msg.ID, } - b, _ := json.Marshal(m) + b, err := json.Marshal(m) + if err != nil { + logOnError(err, "getHistory : Marshaling message.") + } - _ = ch.Publish( + err = ch.Publish( "", // exchange q.Name, // routing key false, // mandatory @@ -167,6 +170,9 @@ func getHistory(c *tdlib.Client) { ContentType: "application/json", Body: []byte(b), }) + if err != nil { + logOnError(err, "getHistory : Publishing message.") + } if msg.ID < lastMsgID64 { lastMsgID64 = msg.ID lastMsgTime = time.Unix(int64(msg.Date), 0)