From 8966d811995c2ea8768837a3551c37b6dcd211e4 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Thu, 5 Nov 2020 17:07:24 +0100 Subject: [PATCH] linting --- protocol/message_persistence.go | 4 ++-- protocol/messenger.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/protocol/message_persistence.go b/protocol/message_persistence.go index 44b6677796c..501db8334b7 100644 --- a/protocol/message_persistence.go +++ b/protocol/message_persistence.go @@ -467,7 +467,7 @@ func (db sqlitePersistence) MessagesByIDs(ids []string) ([]*common.Message, erro func (db sqlitePersistence) MessageByChatID(chatID string, currCursor string, limit int) ([]*common.Message, string, error) { cursorWhere := "" if currCursor != "" { - cursorWhere = "AND cursor <= ?" + cursorWhere = "AND cursor <= ?" //nolint: goconst } allFields := db.tableUserMessagesAllFieldsJoin() args := []interface{}{chatID} @@ -536,7 +536,7 @@ func (db sqlitePersistence) MessageByChatID(chatID string, currCursor string, li func (db sqlitePersistence) MessageByChatIDs(chatIDs []string, currCursor string, limit int) ([]*common.Message, string, error) { cursorWhere := "" if currCursor != "" { - cursorWhere = "AND cursor <= ?" + cursorWhere = "AND cursor <= ?" //nolint: goconst } allFields := db.tableUserMessagesAllFieldsJoin() args := make([]interface{}, len(chatIDs)) diff --git a/protocol/messenger.go b/protocol/messenger.go index 7049c40a3b3..58afc3b9d30 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -2600,9 +2600,8 @@ func (m *Messenger) MessageByChatID(chatID, cursor string, limit int) ([]*common } } return m.persistence.MessageByChatIDs(chatIDs, cursor, limit) - } else { - return m.persistence.MessageByChatID(chatID, cursor, limit) } + return m.persistence.MessageByChatID(chatID, cursor, limit) } func (m *Messenger) SaveMessages(messages []*common.Message) error {