From eda7ace3f808bce5b633e1acd4b6c2007434592c Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Mon, 9 Nov 2020 17:55:06 +0100 Subject: [PATCH] Make golangci-lint happy --- syncapi/storage/postgres/receipt_table.go | 1 + syncapi/storage/postgres/syncserver.go | 2 -- syncapi/storage/shared/syncserver.go | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/syncapi/storage/postgres/receipt_table.go b/syncapi/storage/postgres/receipt_table.go index 97b1585a0..c5ec6cbc6 100644 --- a/syncapi/storage/postgres/receipt_table.go +++ b/syncapi/storage/postgres/receipt_table.go @@ -30,6 +30,7 @@ import ( ) const receiptsSchema = ` +CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id; -- Stores data about receipts CREATE TABLE IF NOT EXISTS syncapi_receipts ( -- The ID diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go index a50f5a0ce..979e19a0b 100644 --- a/syncapi/storage/postgres/syncserver.go +++ b/syncapi/storage/postgres/syncserver.go @@ -35,8 +35,6 @@ type SyncServerDatasource struct { sqlutil.PartitionOffsetStatements } -const createSequence = "CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id;" - // NewDatabase creates a new sync server database func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) { var d SyncServerDatasource diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go index 3194ca597..2b82ee33c 100644 --- a/syncapi/storage/shared/syncserver.go +++ b/syncapi/storage/shared/syncserver.go @@ -621,7 +621,7 @@ func (d *Database) addEDUDeltaToResponse( if fromPos.EDUPosition() != toPos.EDUPosition() { // add typing deltas if err := d.addTypingDeltaToResponse(fromPos, joinedRoomIDs, res); err != nil { - return fmt.Errorf("unable to apply typing delta to response: %w") + return fmt.Errorf("unable to apply typing delta to response: %w", err) } } @@ -629,7 +629,7 @@ func (d *Database) addEDUDeltaToResponse( if (fromPos.EDUPosition() == 0 && toPos.EDUPosition() == 0) || fromPos.EDUPosition() != toPos.EDUPosition() { if err := d.addReceiptDeltaToResponse(fromPos, joinedRoomIDs, res); err != nil { - return fmt.Errorf("unable to apply receipts to response: %w") + return fmt.Errorf("unable to apply receipts to response: %w", err) } }