From 11b48749bf96fb1f7761df6d7a21cf1cd8484e20 Mon Sep 17 00:00:00 2001 From: Till Faelligen <2353100+S7evinK@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:40:08 +0100 Subject: [PATCH] Fix linting --- build/dendritejs-pinecone/jsServer.go | 15 +++++++++------ clientapi/routing/admin.go | 2 +- clientapi/routing/membership.go | 2 +- clientapi/routing/room_hierarchy.go | 2 +- cmd/dendrite-demo-pinecone/monolith/monolith.go | 4 ++-- cmd/dendrite-demo-yggdrasil/main.go | 4 ++-- cmd/dendrite/main.go | 2 +- contrib/dendrite-demo-i2p/main.go | 2 +- contrib/dendrite-demo-i2p/main_i2p.go | 6 +++--- contrib/dendrite-demo-tor/main.go | 2 +- contrib/dendrite-demo-tor/main_tor.go | 6 +++--- federationapi/consumers/receipts.go | 2 +- federationapi/routing/profile_test.go | 2 +- federationapi/routing/query_test.go | 2 +- federationapi/routing/routing.go | 4 ++-- federationapi/routing/send_test.go | 2 +- .../storage/postgres/joined_hosts_table.go | 2 +- .../postgres/notary_server_keys_metadata_table.go | 2 +- .../storage/postgres/queue_json_table.go | 2 +- .../storage/postgres/queue_pdus_table.go | 2 +- .../storage/postgres/relay_servers_table.go | 2 +- .../storage/postgres/server_key_table.go | 2 +- internal/transactionrequest.go | 2 +- mediaapi/routing/routing.go | 2 +- mediaapi/storage/postgres/mediaapi.go | 2 +- relayapi/relayapi_test.go | 2 +- relayapi/routing/routing.go | 4 ++-- .../storage/postgres/relay_queue_json_table.go | 2 +- relayapi/storage/postgres/relay_queue_table.go | 2 +- .../internal/perform/perform_create_room.go | 2 +- .../2021041615092700_state_blocks_refactor.go | 2 +- .../deltas/20230516154000_drop_reference_sha.go | 2 +- .../20230516154000_drop_reference_sha_test.go | 2 +- .../storage/postgres/event_state_keys_table.go | 2 +- roomserver/storage/postgres/event_types_table.go | 2 +- roomserver/storage/postgres/events_table.go | 2 +- roomserver/storage/postgres/rooms_table.go | 2 +- roomserver/storage/postgres/state_block_table.go | 2 +- .../storage/postgres/user_room_keys_table.go | 2 +- .../deltas/20230516154000_drop_reference_sha.go | 2 +- setup/base/base.go | 4 ++-- setup/mscs/msc2836/msc2836_test.go | 2 +- syncapi/consumers/keychange.go | 2 +- syncapi/consumers/roomserver.go | 2 +- syncapi/storage/postgres/account_data_table.go | 2 +- .../storage/postgres/current_room_state_table.go | 2 +- .../storage/postgres/output_room_events_table.go | 2 +- syncapi/storage/postgres/syncserver.go | 2 +- syncapi/syncapi_test.go | 2 +- userapi/storage/postgres/devices_table.go | 2 +- userapi/storage/postgres/one_time_keys_table.go | 2 +- 51 files changed, 68 insertions(+), 65 deletions(-) diff --git a/build/dendritejs-pinecone/jsServer.go b/build/dendritejs-pinecone/jsServer.go index 57e1f610..f2f60f0b 100644 --- a/build/dendritejs-pinecone/jsServer.go +++ b/build/dendritejs-pinecone/jsServer.go @@ -26,13 +26,16 @@ type JSServer struct { // OnRequestFromJS is the function that JS will invoke when there is a new request. // The JS function signature is: -// function(reqString: string): Promise<{result: string, error: string}> +// +// function(reqString: string): Promise<{result: string, error: string}> +// // Usage is like: -// const res = await global._go_js_server.fetch(reqString); -// if (res.error) { -// // handle error: this is a 'network' error, not a non-2xx error. -// } -// const rawHttpResponse = res.result; +// +// const res = await global._go_js_server.fetch(reqString); +// if (res.error) { +// // handle error: this is a 'network' error, not a non-2xx error. +// } +// const rawHttpResponse = res.result; func (h *JSServer) OnRequestFromJS(this js.Value, args []js.Value) interface{} { // we HAVE to spawn a new goroutine and return immediately or else Go will deadlock // if this request blocks at all e.g for /sync calls diff --git a/clientapi/routing/admin.go b/clientapi/routing/admin.go index 2c8f3160..48e58209 100644 --- a/clientapi/routing/admin.go +++ b/clientapi/routing/admin.go @@ -10,9 +10,9 @@ import ( "strconv" "time" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/eventutil" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" "github.com/matrix-org/util" diff --git a/clientapi/routing/membership.go b/clientapi/routing/membership.go index c2b26d08..9579e648 100644 --- a/clientapi/routing/membership.go +++ b/clientapi/routing/membership.go @@ -13,7 +13,6 @@ import ( "net/http" "time" - "github.com/getsentry/sentry-go" appserviceAPI "github.com/element-hq/dendrite/appservice/api" "github.com/element-hq/dendrite/clientapi/auth/authtypes" "github.com/element-hq/dendrite/clientapi/httputil" @@ -24,6 +23,7 @@ import ( "github.com/element-hq/dendrite/roomserver/types" "github.com/element-hq/dendrite/setup/config" userapi "github.com/element-hq/dendrite/userapi/api" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/clientapi/routing/room_hierarchy.go b/clientapi/routing/room_hierarchy.go index c8f33550..82ee3580 100644 --- a/clientapi/routing/room_hierarchy.go +++ b/clientapi/routing/room_hierarchy.go @@ -11,10 +11,10 @@ import ( "strconv" "sync" - "github.com/google/uuid" roomserverAPI "github.com/element-hq/dendrite/roomserver/api" "github.com/element-hq/dendrite/roomserver/types" userapi "github.com/element-hq/dendrite/userapi/api" + "github.com/google/uuid" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" "github.com/matrix-org/util" diff --git a/cmd/dendrite-demo-pinecone/monolith/monolith.go b/cmd/dendrite-demo-pinecone/monolith/monolith.go index d8b5f1c8..2fb5e675 100644 --- a/cmd/dendrite-demo-pinecone/monolith/monolith.go +++ b/cmd/dendrite-demo-pinecone/monolith/monolith.go @@ -18,8 +18,6 @@ import ( "sync" "time" - "github.com/gorilla/mux" - "github.com/gorilla/websocket" "github.com/element-hq/dendrite/appservice" "github.com/element-hq/dendrite/cmd/dendrite-demo-pinecone/conn" "github.com/element-hq/dendrite/cmd/dendrite-demo-pinecone/embed" @@ -43,6 +41,8 @@ import ( "github.com/element-hq/dendrite/setup/process" "github.com/element-hq/dendrite/userapi" userAPI "github.com/element-hq/dendrite/userapi/api" + "github.com/gorilla/mux" + "github.com/gorilla/websocket" "github.com/matrix-org/gomatrixserverlib/spec" "github.com/sirupsen/logrus" diff --git a/cmd/dendrite-demo-yggdrasil/main.go b/cmd/dendrite-demo-yggdrasil/main.go index 8a0e3ee1..2c1eea38 100644 --- a/cmd/dendrite-demo-yggdrasil/main.go +++ b/cmd/dendrite-demo-yggdrasil/main.go @@ -19,15 +19,14 @@ import ( "path/filepath" "time" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/internal/caching" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/setup/process" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/appservice" "github.com/element-hq/dendrite/cmd/dendrite-demo-yggdrasil/embed" "github.com/element-hq/dendrite/cmd/dendrite-demo-yggdrasil/signing" @@ -44,6 +43,7 @@ import ( "github.com/element-hq/dendrite/setup/mscs" "github.com/element-hq/dendrite/test" "github.com/element-hq/dendrite/userapi" + "github.com/gorilla/mux" "github.com/sirupsen/logrus" ) diff --git a/cmd/dendrite/main.go b/cmd/dendrite/main.go index 1a1a9f4c..da43432f 100644 --- a/cmd/dendrite/main.go +++ b/cmd/dendrite/main.go @@ -10,13 +10,13 @@ import ( "flag" "time" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/caching" "github.com/element-hq/dendrite/internal/httputil" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/setup/process" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" diff --git a/contrib/dendrite-demo-i2p/main.go b/contrib/dendrite-demo-i2p/main.go index 107bab88..27f69acb 100644 --- a/contrib/dendrite-demo-i2p/main.go +++ b/contrib/dendrite-demo-i2p/main.go @@ -11,13 +11,13 @@ import ( "os" "time" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/caching" "github.com/element-hq/dendrite/internal/httputil" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/setup/process" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" diff --git a/contrib/dendrite-demo-i2p/main_i2p.go b/contrib/dendrite-demo-i2p/main_i2p.go index ab86afd6..9104b7e1 100644 --- a/contrib/dendrite-demo-i2p/main_i2p.go +++ b/contrib/dendrite-demo-i2p/main_i2p.go @@ -19,14 +19,14 @@ import ( "text/template" "github.com/cretz/bine/tor" + "github.com/element-hq/dendrite/internal" + "github.com/element-hq/dendrite/internal/httputil" + "github.com/element-hq/dendrite/setup/process" "github.com/eyedeekay/goSam" "github.com/eyedeekay/onramp" sentryhttp "github.com/getsentry/sentry-go/http" "github.com/gorilla/mux" "github.com/kardianos/minwinsvc" - "github.com/element-hq/dendrite/internal" - "github.com/element-hq/dendrite/internal/httputil" - "github.com/element-hq/dendrite/setup/process" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" diff --git a/contrib/dendrite-demo-tor/main.go b/contrib/dendrite-demo-tor/main.go index 22d7c715..132b557f 100644 --- a/contrib/dendrite-demo-tor/main.go +++ b/contrib/dendrite-demo-tor/main.go @@ -10,13 +10,13 @@ import ( "os" "time" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/caching" "github.com/element-hq/dendrite/internal/httputil" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/setup/process" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" diff --git a/contrib/dendrite-demo-tor/main_tor.go b/contrib/dendrite-demo-tor/main_tor.go index 7826759f..8e73212a 100644 --- a/contrib/dendrite-demo-tor/main_tor.go +++ b/contrib/dendrite-demo-tor/main_tor.go @@ -18,13 +18,13 @@ import ( "text/template" "github.com/cretz/bine/tor" + "github.com/element-hq/dendrite/internal" + "github.com/element-hq/dendrite/internal/httputil" + "github.com/element-hq/dendrite/setup/process" "github.com/eyedeekay/onramp" sentryhttp "github.com/getsentry/sentry-go/http" "github.com/gorilla/mux" "github.com/kardianos/minwinsvc" - "github.com/element-hq/dendrite/internal" - "github.com/element-hq/dendrite/internal/httputil" - "github.com/element-hq/dendrite/setup/process" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" diff --git a/federationapi/consumers/receipts.go b/federationapi/consumers/receipts.go index f0267eba..c1234028 100644 --- a/federationapi/consumers/receipts.go +++ b/federationapi/consumers/receipts.go @@ -11,7 +11,6 @@ import ( "encoding/json" "strconv" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/federationapi/queue" "github.com/element-hq/dendrite/federationapi/storage" fedTypes "github.com/element-hq/dendrite/federationapi/types" @@ -19,6 +18,7 @@ import ( "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/setup/process" syncTypes "github.com/element-hq/dendrite/syncapi/types" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" "github.com/nats-io/nats.go" diff --git a/federationapi/routing/profile_test.go b/federationapi/routing/profile_test.go index f52d2e62..96482b5c 100644 --- a/federationapi/routing/profile_test.go +++ b/federationapi/routing/profile_test.go @@ -14,7 +14,6 @@ import ( "net/url" "testing" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/clientapi/auth/authtypes" "github.com/element-hq/dendrite/cmd/dendrite-demo-yggdrasil/signing" fedAPI "github.com/element-hq/dendrite/federationapi" @@ -26,6 +25,7 @@ import ( "github.com/element-hq/dendrite/test" "github.com/element-hq/dendrite/test/testrig" userAPI "github.com/element-hq/dendrite/userapi/api" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/federationapi/routing/query_test.go b/federationapi/routing/query_test.go index b9a7ab29..27ef4c6a 100644 --- a/federationapi/routing/query_test.go +++ b/federationapi/routing/query_test.go @@ -14,7 +14,6 @@ import ( "net/url" "testing" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/cmd/dendrite-demo-yggdrasil/signing" fedAPI "github.com/element-hq/dendrite/federationapi" "github.com/element-hq/dendrite/federationapi/routing" @@ -24,6 +23,7 @@ import ( "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/test" "github.com/element-hq/dendrite/test/testrig" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go index 3073a512..5043722e 100644 --- a/federationapi/routing/routing.go +++ b/federationapi/routing/routing.go @@ -14,8 +14,6 @@ import ( "sync" "time" - "github.com/getsentry/sentry-go" - "github.com/gorilla/mux" fedInternal "github.com/element-hq/dendrite/federationapi/internal" "github.com/element-hq/dendrite/federationapi/producers" "github.com/element-hq/dendrite/internal" @@ -24,6 +22,8 @@ import ( roomserverAPI "github.com/element-hq/dendrite/roomserver/api" "github.com/element-hq/dendrite/setup/config" userapi "github.com/element-hq/dendrite/userapi/api" + "github.com/getsentry/sentry-go" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/federationapi/routing/send_test.go b/federationapi/routing/send_test.go index b0dfda96..c20a9d59 100644 --- a/federationapi/routing/send_test.go +++ b/federationapi/routing/send_test.go @@ -12,7 +12,6 @@ import ( "net/http/httptest" "testing" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/cmd/dendrite-demo-yggdrasil/signing" fedAPI "github.com/element-hq/dendrite/federationapi" "github.com/element-hq/dendrite/federationapi/routing" @@ -22,6 +21,7 @@ import ( "github.com/element-hq/dendrite/setup/jetstream" "github.com/element-hq/dendrite/test" "github.com/element-hq/dendrite/test/testrig" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/federationapi/storage/postgres/joined_hosts_table.go b/federationapi/storage/postgres/joined_hosts_table.go index 08dbf744..4e6fed7a 100644 --- a/federationapi/storage/postgres/joined_hosts_table.go +++ b/federationapi/storage/postgres/joined_hosts_table.go @@ -11,10 +11,10 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/federationapi/types" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/federationapi/storage/postgres/notary_server_keys_metadata_table.go b/federationapi/storage/postgres/notary_server_keys_metadata_table.go index 20573f39..87bff129 100644 --- a/federationapi/storage/postgres/notary_server_keys_metadata_table.go +++ b/federationapi/storage/postgres/notary_server_keys_metadata_table.go @@ -11,10 +11,10 @@ import ( "database/sql" "encoding/json" - "github.com/lib/pq" "github.com/element-hq/dendrite/federationapi/storage/tables" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/federationapi/storage/postgres/queue_json_table.go b/federationapi/storage/postgres/queue_json_table.go index 2b93bfdc..ef0d9eab 100644 --- a/federationapi/storage/postgres/queue_json_table.go +++ b/federationapi/storage/postgres/queue_json_table.go @@ -10,9 +10,9 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" ) const queueJSONSchema = ` diff --git a/federationapi/storage/postgres/queue_pdus_table.go b/federationapi/storage/postgres/queue_pdus_table.go index 46011334..7748d9ca 100644 --- a/federationapi/storage/postgres/queue_pdus_table.go +++ b/federationapi/storage/postgres/queue_pdus_table.go @@ -10,9 +10,9 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/federationapi/storage/postgres/relay_servers_table.go b/federationapi/storage/postgres/relay_servers_table.go index 7ca7ad35..0a02cf91 100644 --- a/federationapi/storage/postgres/relay_servers_table.go +++ b/federationapi/storage/postgres/relay_servers_table.go @@ -10,9 +10,9 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/federationapi/storage/postgres/server_key_table.go b/federationapi/storage/postgres/server_key_table.go index 632dfd17..656ffd68 100644 --- a/federationapi/storage/postgres/server_key_table.go +++ b/federationapi/storage/postgres/server_key_table.go @@ -11,9 +11,9 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/internal/transactionrequest.go b/internal/transactionrequest.go index 26f2bcab..474195f6 100644 --- a/internal/transactionrequest.go +++ b/internal/transactionrequest.go @@ -12,13 +12,13 @@ import ( "fmt" "sync" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/federationapi/producers" "github.com/element-hq/dendrite/federationapi/types" "github.com/element-hq/dendrite/roomserver/api" rstypes "github.com/element-hq/dendrite/roomserver/types" syncTypes "github.com/element-hq/dendrite/syncapi/types" userAPI "github.com/element-hq/dendrite/userapi/api" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go index 006a54b9..45da8eba 100644 --- a/mediaapi/routing/routing.go +++ b/mediaapi/routing/routing.go @@ -11,13 +11,13 @@ import ( "net/http" "strings" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/federationapi/routing" "github.com/element-hq/dendrite/internal/httputil" "github.com/element-hq/dendrite/mediaapi/storage" "github.com/element-hq/dendrite/mediaapi/types" "github.com/element-hq/dendrite/setup/config" userapi "github.com/element-hq/dendrite/userapi/api" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/mediaapi/storage/postgres/mediaapi.go b/mediaapi/storage/postgres/mediaapi.go index 87067568..199514df 100644 --- a/mediaapi/storage/postgres/mediaapi.go +++ b/mediaapi/storage/postgres/mediaapi.go @@ -9,10 +9,10 @@ package postgres import ( // Import the postgres database driver. - _ "github.com/lib/pq" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/mediaapi/storage/shared" "github.com/element-hq/dendrite/setup/config" + _ "github.com/lib/pq" ) // NewDatabase opens a postgres database. diff --git a/relayapi/relayapi_test.go b/relayapi/relayapi_test.go index e4e8b25d..d27111bc 100644 --- a/relayapi/relayapi_test.go +++ b/relayapi/relayapi_test.go @@ -15,7 +15,6 @@ import ( "testing" "time" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/cmd/dendrite-demo-yggdrasil/signing" "github.com/element-hq/dendrite/internal/caching" "github.com/element-hq/dendrite/internal/httputil" @@ -23,6 +22,7 @@ import ( "github.com/element-hq/dendrite/relayapi" "github.com/element-hq/dendrite/test" "github.com/element-hq/dendrite/test/testrig" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/relayapi/routing/routing.go b/relayapi/routing/routing.go index 4d810a62..abb39715 100644 --- a/relayapi/routing/routing.go +++ b/relayapi/routing/routing.go @@ -11,11 +11,11 @@ import ( "net/http" "time" - "github.com/getsentry/sentry-go" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/internal/httputil" relayInternal "github.com/element-hq/dendrite/relayapi/internal" "github.com/element-hq/dendrite/setup/config" + "github.com/getsentry/sentry-go" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/relayapi/storage/postgres/relay_queue_json_table.go b/relayapi/storage/postgres/relay_queue_json_table.go index 5b7a2333..cc15a5ed 100644 --- a/relayapi/storage/postgres/relay_queue_json_table.go +++ b/relayapi/storage/postgres/relay_queue_json_table.go @@ -10,9 +10,9 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" ) const relayQueueJSONSchema = ` diff --git a/relayapi/storage/postgres/relay_queue_table.go b/relayapi/storage/postgres/relay_queue_table.go index c8e63465..79d5ecd8 100644 --- a/relayapi/storage/postgres/relay_queue_table.go +++ b/relayapi/storage/postgres/relay_queue_table.go @@ -10,9 +10,9 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/roomserver/internal/perform/perform_create_room.go b/roomserver/internal/perform/perform_create_room.go index d5ddb5cd..73ae9ff6 100644 --- a/roomserver/internal/perform/perform_create_room.go +++ b/roomserver/internal/perform/perform_create_room.go @@ -13,12 +13,12 @@ import ( "fmt" "net/http" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/internal/eventutil" "github.com/element-hq/dendrite/roomserver/api" "github.com/element-hq/dendrite/roomserver/storage" "github.com/element-hq/dendrite/roomserver/types" "github.com/element-hq/dendrite/setup/config" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/roomserver/storage/postgres/deltas/2021041615092700_state_blocks_refactor.go b/roomserver/storage/postgres/deltas/2021041615092700_state_blocks_refactor.go index c6bb1863..3c0a3fa0 100644 --- a/roomserver/storage/postgres/deltas/2021041615092700_state_blocks_refactor.go +++ b/roomserver/storage/postgres/deltas/2021041615092700_state_blocks_refactor.go @@ -11,8 +11,8 @@ import ( "database/sql" "fmt" - "github.com/lib/pq" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" "github.com/matrix-org/util" "github.com/sirupsen/logrus" ) diff --git a/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha.go b/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha.go index 045d7ab6..00cc4c66 100644 --- a/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha.go +++ b/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha.go @@ -11,8 +11,8 @@ import ( "database/sql" "fmt" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" + "github.com/lib/pq" "github.com/matrix-org/util" ) diff --git a/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha_test.go b/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha_test.go index 7a5a029a..9ff1003b 100644 --- a/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha_test.go +++ b/roomserver/storage/postgres/deltas/20230516154000_drop_reference_sha_test.go @@ -3,10 +3,10 @@ package deltas import ( "testing" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/test" "github.com/element-hq/dendrite/test/testrig" + "github.com/lib/pq" "github.com/stretchr/testify/assert" ) diff --git a/roomserver/storage/postgres/event_state_keys_table.go b/roomserver/storage/postgres/event_state_keys_table.go index 624ccd79..01cfdbfd 100644 --- a/roomserver/storage/postgres/event_state_keys_table.go +++ b/roomserver/storage/postgres/event_state_keys_table.go @@ -11,11 +11,11 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/storage/tables" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" ) const eventStateKeysSchema = ` diff --git a/roomserver/storage/postgres/event_types_table.go b/roomserver/storage/postgres/event_types_table.go index 32d2d4b1..cd406c15 100644 --- a/roomserver/storage/postgres/event_types_table.go +++ b/roomserver/storage/postgres/event_types_table.go @@ -11,11 +11,11 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/storage/tables" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" ) const eventTypesSchema = ` diff --git a/roomserver/storage/postgres/events_table.go b/roomserver/storage/postgres/events_table.go index 70eefbe7..03215f19 100644 --- a/roomserver/storage/postgres/events_table.go +++ b/roomserver/storage/postgres/events_table.go @@ -13,12 +13,12 @@ import ( "fmt" "sort" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/storage/postgres/deltas" "github.com/element-hq/dendrite/roomserver/storage/tables" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" ) const eventsSchema = ` diff --git a/roomserver/storage/postgres/rooms_table.go b/roomserver/storage/postgres/rooms_table.go index f8a6efb2..4e040b9a 100644 --- a/roomserver/storage/postgres/rooms_table.go +++ b/roomserver/storage/postgres/rooms_table.go @@ -11,11 +11,11 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/storage/tables" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/roomserver/storage/postgres/state_block_table.go b/roomserver/storage/postgres/state_block_table.go index e77d6e51..27b72811 100644 --- a/roomserver/storage/postgres/state_block_table.go +++ b/roomserver/storage/postgres/state_block_table.go @@ -12,11 +12,11 @@ import ( "database/sql" "fmt" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/storage/tables" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" "github.com/matrix-org/util" ) diff --git a/roomserver/storage/postgres/user_room_keys_table.go b/roomserver/storage/postgres/user_room_keys_table.go index 7ddbde76..29f6f856 100644 --- a/roomserver/storage/postgres/user_room_keys_table.go +++ b/roomserver/storage/postgres/user_room_keys_table.go @@ -12,11 +12,11 @@ import ( "database/sql" "errors" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/storage/tables" "github.com/element-hq/dendrite/roomserver/types" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/roomserver/storage/sqlite3/deltas/20230516154000_drop_reference_sha.go b/roomserver/storage/sqlite3/deltas/20230516154000_drop_reference_sha.go index da37a7fe..da9f1c22 100644 --- a/roomserver/storage/sqlite3/deltas/20230516154000_drop_reference_sha.go +++ b/roomserver/storage/sqlite3/deltas/20230516154000_drop_reference_sha.go @@ -11,8 +11,8 @@ import ( "database/sql" "fmt" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" + "github.com/lib/pq" "github.com/matrix-org/util" ) diff --git a/setup/base/base.go b/setup/base/base.go index 9b8f1f92..359a6816 100644 --- a/setup/base/base.go +++ b/setup/base/base.go @@ -28,10 +28,10 @@ import ( "github.com/matrix-org/gomatrixserverlib/fclient" "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/gorilla/mux" - "github.com/kardianos/minwinsvc" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/httputil" + "github.com/gorilla/mux" + "github.com/kardianos/minwinsvc" "github.com/sirupsen/logrus" diff --git a/setup/mscs/msc2836/msc2836_test.go b/setup/mscs/msc2836/msc2836_test.go index 63bc2c18..5b85e670 100644 --- a/setup/mscs/msc2836/msc2836_test.go +++ b/setup/mscs/msc2836/msc2836_test.go @@ -14,9 +14,9 @@ import ( "testing" "time" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/setup/process" "github.com/element-hq/dendrite/syncapi/synctypes" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" diff --git a/syncapi/consumers/keychange.go b/syncapi/consumers/keychange.go index 51169d6b..39f21306 100644 --- a/syncapi/consumers/keychange.go +++ b/syncapi/consumers/keychange.go @@ -10,7 +10,6 @@ import ( "context" "encoding/json" - "github.com/getsentry/sentry-go" roomserverAPI "github.com/element-hq/dendrite/roomserver/api" "github.com/element-hq/dendrite/setup/config" "github.com/element-hq/dendrite/setup/jetstream" @@ -20,6 +19,7 @@ import ( "github.com/element-hq/dendrite/syncapi/streams" "github.com/element-hq/dendrite/syncapi/types" "github.com/element-hq/dendrite/userapi/api" + "github.com/getsentry/sentry-go" "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" ) diff --git a/syncapi/consumers/roomserver.go b/syncapi/consumers/roomserver.go index 907c2b8a..75afa1c9 100644 --- a/syncapi/consumers/roomserver.go +++ b/syncapi/consumers/roomserver.go @@ -14,7 +14,6 @@ import ( "errors" "fmt" - "github.com/getsentry/sentry-go" "github.com/element-hq/dendrite/internal/fulltext" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/api" @@ -28,6 +27,7 @@ import ( "github.com/element-hq/dendrite/syncapi/streams" "github.com/element-hq/dendrite/syncapi/synctypes" "github.com/element-hq/dendrite/syncapi/types" + "github.com/getsentry/sentry-go" "github.com/matrix-org/gomatrixserverlib/spec" "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" diff --git a/syncapi/storage/postgres/account_data_table.go b/syncapi/storage/postgres/account_data_table.go index 51d12591..e4b558ff 100644 --- a/syncapi/storage/postgres/account_data_table.go +++ b/syncapi/storage/postgres/account_data_table.go @@ -11,12 +11,12 @@ import ( "context" "database/sql" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/syncapi/storage/tables" "github.com/element-hq/dendrite/syncapi/synctypes" "github.com/element-hq/dendrite/syncapi/types" + "github.com/lib/pq" ) const accountDataSchema = ` diff --git a/syncapi/storage/postgres/current_room_state_table.go b/syncapi/storage/postgres/current_room_state_table.go index 506ebf0c..2e75fefb 100644 --- a/syncapi/storage/postgres/current_room_state_table.go +++ b/syncapi/storage/postgres/current_room_state_table.go @@ -13,7 +13,6 @@ import ( "encoding/json" "errors" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" rstypes "github.com/element-hq/dendrite/roomserver/types" @@ -21,6 +20,7 @@ import ( "github.com/element-hq/dendrite/syncapi/storage/tables" "github.com/element-hq/dendrite/syncapi/synctypes" "github.com/element-hq/dendrite/syncapi/types" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/syncapi/storage/postgres/output_room_events_table.go b/syncapi/storage/postgres/output_room_events_table.go index 03633f5c..1ca426f6 100644 --- a/syncapi/storage/postgres/output_room_events_table.go +++ b/syncapi/storage/postgres/output_room_events_table.go @@ -14,7 +14,6 @@ import ( "fmt" "sort" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/roomserver/api" @@ -23,6 +22,7 @@ import ( "github.com/element-hq/dendrite/syncapi/storage/tables" "github.com/element-hq/dendrite/syncapi/synctypes" "github.com/element-hq/dendrite/syncapi/types" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib" ) diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go index e6f79f46..321b55b7 100644 --- a/syncapi/storage/postgres/syncserver.go +++ b/syncapi/storage/postgres/syncserver.go @@ -12,11 +12,11 @@ import ( "database/sql" // Import the postgres database driver. - _ "github.com/lib/pq" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/setup/config" "github.com/element-hq/dendrite/syncapi/storage/postgres/deltas" "github.com/element-hq/dendrite/syncapi/storage/shared" + _ "github.com/lib/pq" ) // SyncServerDatasource represents a sync server datasource which manages diff --git a/syncapi/syncapi_test.go b/syncapi/syncapi_test.go index 9a9c9b9c..4e1fa7df 100644 --- a/syncapi/syncapi_test.go +++ b/syncapi/syncapi_test.go @@ -11,11 +11,11 @@ import ( "testing" "time" - "github.com/gorilla/mux" "github.com/element-hq/dendrite/internal/caching" "github.com/element-hq/dendrite/internal/httputil" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/setup/config" + "github.com/gorilla/mux" "github.com/matrix-org/gomatrixserverlib" "github.com/matrix-org/gomatrixserverlib/spec" "github.com/nats-io/nats.go" diff --git a/userapi/storage/postgres/devices_table.go b/userapi/storage/postgres/devices_table.go index a12e4b17..b5feea07 100644 --- a/userapi/storage/postgres/devices_table.go +++ b/userapi/storage/postgres/devices_table.go @@ -12,13 +12,13 @@ import ( "fmt" "time" - "github.com/lib/pq" "github.com/element-hq/dendrite/clientapi/userutil" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/userapi/api" "github.com/element-hq/dendrite/userapi/storage/postgres/deltas" "github.com/element-hq/dendrite/userapi/storage/tables" + "github.com/lib/pq" "github.com/matrix-org/gomatrixserverlib/spec" ) diff --git a/userapi/storage/postgres/one_time_keys_table.go b/userapi/storage/postgres/one_time_keys_table.go index 397cb7d6..dde63a17 100644 --- a/userapi/storage/postgres/one_time_keys_table.go +++ b/userapi/storage/postgres/one_time_keys_table.go @@ -12,11 +12,11 @@ import ( "encoding/json" "time" - "github.com/lib/pq" "github.com/element-hq/dendrite/internal" "github.com/element-hq/dendrite/internal/sqlutil" "github.com/element-hq/dendrite/userapi/api" "github.com/element-hq/dendrite/userapi/storage/tables" + "github.com/lib/pq" ) var oneTimeKeysSchema = `