Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK committed Nov 14, 2024
1 parent 3ca9dae commit 11b4874
Show file tree
Hide file tree
Showing 51 changed files with 68 additions and 65 deletions.
15 changes: 9 additions & 6 deletions build/dendritejs-pinecone/jsServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion clientapi/routing/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion clientapi/routing/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion clientapi/routing/room_hierarchy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions cmd/dendrite-demo-pinecone/monolith/monolith.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions cmd/dendrite-demo-yggdrasil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/dendrite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion contrib/dendrite-demo-i2p/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions contrib/dendrite-demo-i2p/main_i2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion contrib/dendrite-demo-tor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions contrib/dendrite-demo-tor/main_tor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion federationapi/consumers/receipts.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ 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"
"github.com/element-hq/dendrite/setup/config"
"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"
Expand Down
2 changes: 1 addition & 1 deletion federationapi/routing/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion federationapi/routing/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions federationapi/routing/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion federationapi/routing/send_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion federationapi/storage/postgres/joined_hosts_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion federationapi/storage/postgres/queue_json_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down
2 changes: 1 addition & 1 deletion federationapi/storage/postgres/queue_pdus_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion federationapi/storage/postgres/relay_servers_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion federationapi/storage/postgres/server_key_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/transactionrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion mediaapi/routing/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion mediaapi/storage/postgres/mediaapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion relayapi/relayapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ 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"
"github.com/element-hq/dendrite/internal/sqlutil"
"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"
Expand Down
Loading

0 comments on commit 11b4874

Please sign in to comment.