From a19cc4740eb62190c8f7696426620db0906ff757 Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Sat, 27 Mar 2021 16:28:57 +0100 Subject: [PATCH] go fmt ./... --- cmd/gotosocial/main.go | 2 +- internal/action/action.go | 2 +- internal/db/actions.go | 2 +- internal/db/db.go | 2 +- internal/db/pg.go | 12 ++++++------ internal/gotosocial/actions.go | 2 +- internal/module/account/account.go | 8 ++++---- internal/module/app/app.go | 2 +- internal/module/auth/auth.go | 2 +- internal/module/auth/auth_test.go | 4 ++-- internal/oauth/clientstore_test.go | 4 ++-- internal/oauth/tokenstore.go | 2 +- internal/router/router.go | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cmd/gotosocial/main.go b/cmd/gotosocial/main.go index 4d721f5..a850938 100644 --- a/cmd/gotosocial/main.go +++ b/cmd/gotosocial/main.go @@ -22,12 +22,12 @@ import ( "fmt" "os" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/action" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gotosocial" "github.com/superseriousbusiness/gotosocial/internal/log" - "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" ) diff --git a/internal/action/action.go b/internal/action/action.go index ce64d6d..de803ba 100644 --- a/internal/action/action.go +++ b/internal/action/action.go @@ -21,8 +21,8 @@ package action import ( "context" - "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/sirupsen/logrus" + "github.com/superseriousbusiness/gotosocial/internal/config" ) // GTSAction defines one *action* that can be taken by the gotosocial cli command. diff --git a/internal/db/actions.go b/internal/db/actions.go index c2d8f76..4288f5f 100644 --- a/internal/db/actions.go +++ b/internal/db/actions.go @@ -21,9 +21,9 @@ package db import ( "context" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/action" "github.com/superseriousbusiness/gotosocial/internal/config" - "github.com/sirupsen/logrus" ) // Initialize will initialize the database given in the config for use with GoToSocial diff --git a/internal/db/db.go b/internal/db/db.go index dcd7cf8..f6c298b 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -25,10 +25,10 @@ import ( "strings" "github.com/go-fed/activity/pub" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db/model" "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" - "github.com/sirupsen/logrus" ) const dbTypePostgres string = "POSTGRES" diff --git a/internal/db/pg.go b/internal/db/pg.go index 621f3a6..6790114 100644 --- a/internal/db/pg.go +++ b/internal/db/pg.go @@ -34,10 +34,10 @@ import ( "github.com/go-pg/pg/extra/pgdebug" "github.com/go-pg/pg/v10" "github.com/go-pg/pg/v10/orm" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db/model" "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" - "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" ) @@ -439,11 +439,11 @@ func (ps *postgresService) NewSignup(username string, reason string, requireAppr return nil, fmt.Errorf("error hashing password: %s", err) } u := &model.User{ - AccountID: a.ID, - EncryptedPassword: string(pw), - SignUpIP: signUpIP, - Locale: locale, - UnconfirmedEmail: email, + AccountID: a.ID, + EncryptedPassword: string(pw), + SignUpIP: signUpIP, + Locale: locale, + UnconfirmedEmail: email, CreatedByApplicationID: appID, } if _, err = ps.conn.Model(u).Insert(); err != nil { diff --git a/internal/gotosocial/actions.go b/internal/gotosocial/actions.go index d9419d6..c348af3 100644 --- a/internal/gotosocial/actions.go +++ b/internal/gotosocial/actions.go @@ -25,10 +25,10 @@ import ( "os/signal" "syscall" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/action" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" - "github.com/sirupsen/logrus" ) // Run creates and starts a gotosocial server diff --git a/internal/module/account/account.go b/internal/module/account/account.go index e68fdb3..ac4c517 100644 --- a/internal/module/account/account.go +++ b/internal/module/account/account.go @@ -24,6 +24,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/db/model" @@ -32,7 +33,6 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/router" "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" "github.com/superseriousbusiness/oauth2/v4" - "github.com/sirupsen/logrus" ) const ( @@ -51,10 +51,10 @@ type accountModule struct { // New returns a new account module func New(config *config.Config, db db.DB, oauthServer oauth.Server, log *logrus.Logger) module.ClientAPIModule { return &accountModule{ - config: config, - db: db, + config: config, + db: db, oauthServer: oauthServer, - log: log, + log: log, } } diff --git a/internal/module/app/app.go b/internal/module/app/app.go index fb75814..67614a0 100644 --- a/internal/module/app/app.go +++ b/internal/module/app/app.go @@ -24,13 +24,13 @@ import ( "github.com/gin-gonic/gin" "github.com/google/uuid" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/db/model" "github.com/superseriousbusiness/gotosocial/internal/module" "github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/router" "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" - "github.com/sirupsen/logrus" ) const appsPath = "/api/v1/apps" diff --git a/internal/module/auth/auth.go b/internal/module/auth/auth.go index e92edb4..0e7a333 100644 --- a/internal/module/auth/auth.go +++ b/internal/module/auth/auth.go @@ -32,13 +32,13 @@ import ( "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/db/model" "github.com/superseriousbusiness/gotosocial/internal/module" "github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/router" "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" - "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" ) diff --git a/internal/module/auth/auth_test.go b/internal/module/auth/auth_test.go index 7a01963..0ec9b4a 100644 --- a/internal/module/auth/auth_test.go +++ b/internal/module/auth/auth_test.go @@ -25,13 +25,13 @@ import ( "time" "github.com/google/uuid" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/suite" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/db/model" "github.com/superseriousbusiness/gotosocial/internal/oauth" "github.com/superseriousbusiness/gotosocial/internal/router" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/suite" "golang.org/x/crypto/bcrypt" ) diff --git a/internal/oauth/clientstore_test.go b/internal/oauth/clientstore_test.go index 6b25bc3..a702822 100644 --- a/internal/oauth/clientstore_test.go +++ b/internal/oauth/clientstore_test.go @@ -21,11 +21,11 @@ import ( "context" "testing" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/suite" "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/oauth2/v4/models" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/suite" ) type PgClientStoreTestSuite struct { diff --git a/internal/oauth/tokenstore.go b/internal/oauth/tokenstore.go index 9b9fb95..eaf6e0a 100644 --- a/internal/oauth/tokenstore.go +++ b/internal/oauth/tokenstore.go @@ -24,10 +24,10 @@ import ( "fmt" "time" + "github.com/sirupsen/logrus" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/oauth2/v4" "github.com/superseriousbusiness/oauth2/v4/models" - "github.com/sirupsen/logrus" ) // tokenStore is an implementation of oauth2.TokenStore, which uses our db interface as a storage backend. diff --git a/internal/router/router.go b/internal/router/router.go index 0e1768a..b60e215 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -29,8 +29,8 @@ import ( "github.com/gin-contrib/sessions" "github.com/gin-contrib/sessions/memstore" "github.com/gin-gonic/gin" - "github.com/superseriousbusiness/gotosocial/internal/config" "github.com/sirupsen/logrus" + "github.com/superseriousbusiness/gotosocial/internal/config" ) // Router provides the REST interface for gotosocial, using gin.