From 007afcae6087068d42d7bc9950d0182dec6e24ee Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 7 Jul 2020 12:09:13 +0100 Subject: [PATCH] Linting --- roomserver/internal/input_events.go | 8 +++++--- roomserver/roomserver_test.go | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/roomserver/internal/input_events.go b/roomserver/internal/input_events.go index 517547c38..04538cf69 100644 --- a/roomserver/internal/input_events.go +++ b/roomserver/internal/input_events.go @@ -32,6 +32,8 @@ import ( // TODO(#375): This should be rewritten to allow concurrent calls. The // difficulty is in ensuring that we correctly annotate events with the correct // state deltas when sending to kafka streams +// TODO: Break up function - we should probably do transaction ID checks before calling this. +// nolint:gocyclo func (r *RoomserverInternalAPI) processRoomEvent( ctx context.Context, input api.InputRoomEvent, @@ -67,9 +69,9 @@ func (r *RoomserverInternalAPI) processRoomEvent( } // if storing this event results in it being redacted then do so. if redactedEventID == event.EventID() { - r, err := eventutil.RedactEvent(redactionEvent, &event) - if err != nil { - return "", err + r, rerr := eventutil.RedactEvent(redactionEvent, &event) + if rerr != nil { + return "", rerr } event = *r } diff --git a/roomserver/roomserver_test.go b/roomserver/roomserver_test.go index 735862409..d553c5b79 100644 --- a/roomserver/roomserver_test.go +++ b/roomserver/roomserver_test.go @@ -18,8 +18,7 @@ import ( ) const ( - testOrigin = gomatrixserverlib.ServerName("kaer.morhen") - testDestination = gomatrixserverlib.ServerName("white.orchard") + testOrigin = gomatrixserverlib.ServerName("kaer.morhen") // we have to use an on-disk DB because we open multiple connections due to the *Updater structs. // Using :memory: results in a brand new DB for each open connection, and sharing memory via // ?cache=shared just allows read-only sharing, so writes to the database on other connections are lost.