From 9191e967a7857e703a8c0f7de6f2107f1c8a349a Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Tue, 7 Sep 2021 18:18:21 +0200 Subject: [PATCH] go fmt --- cmd/gotosocial/admincommands.go | 44 +++++++++++++-------------- internal/config/config.go | 2 +- internal/trans/importer.go | 4 +-- internal/trans/model/block.go | 10 +++--- internal/trans/model/follow.go | 10 +++--- internal/trans/model/followrequest.go | 10 +++--- internal/trans/model/instance.go | 2 +- internal/trans/model/user.go | 10 +++--- internal/trans/trans_test.go | 2 +- 9 files changed, 47 insertions(+), 47 deletions(-) diff --git a/cmd/gotosocial/admincommands.go b/cmd/gotosocial/admincommands.go index 5b60ad050..9dc4bc6e8 100644 --- a/cmd/gotosocial/admincommands.go +++ b/cmd/gotosocial/admincommands.go @@ -40,18 +40,18 @@ func adminCommands() []*cli.Command { Usage: "create a new account", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, &cli.StringFlag{ - Name: config.EmailFlag, - Usage: config.EmailUsage, + Name: config.EmailFlag, + Usage: config.EmailUsage, Required: true, }, &cli.StringFlag{ - Name: config.PasswordFlag, - Usage: config.PasswordUsage, + Name: config.PasswordFlag, + Usage: config.PasswordUsage, Required: true, }, }, @@ -64,8 +64,8 @@ func adminCommands() []*cli.Command { Usage: "confirm an existing account manually, thereby skipping email confirmation", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, }, @@ -78,8 +78,8 @@ func adminCommands() []*cli.Command { Usage: "promote an account to admin", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, }, @@ -92,8 +92,8 @@ func adminCommands() []*cli.Command { Usage: "demote an account from admin to normal user", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, }, @@ -106,8 +106,8 @@ func adminCommands() []*cli.Command { Usage: "prevent an account from signing in or posting etc, but don't delete anything", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, }, @@ -120,8 +120,8 @@ func adminCommands() []*cli.Command { Usage: "completely remove an account and all of its posts, media, etc", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, }, @@ -134,13 +134,13 @@ func adminCommands() []*cli.Command { Usage: "set a new password for the given account", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.UsernameFlag, - Usage: config.UsernameUsage, + Name: config.UsernameFlag, + Usage: config.UsernameUsage, Required: true, }, &cli.StringFlag{ - Name: config.PasswordFlag, - Usage: config.PasswordUsage, + Name: config.PasswordFlag, + Usage: config.PasswordUsage, Required: true, }, }, @@ -155,8 +155,8 @@ func adminCommands() []*cli.Command { Usage: "export data from the database to file at the given path", Flags: []cli.Flag{ &cli.StringFlag{ - Name: config.TransPathFlag, - Usage: config.TransPathUsage, + Name: config.TransPathFlag, + Usage: config.TransPathUsage, Required: true, }, }, diff --git a/internal/config/config.go b/internal/config/config.go index a6768c5b9..bb789b7d2 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -37,7 +37,7 @@ const ( PasswordFlag = "password" PasswordUsage = "the password to set for this account" - TransPathFlag = "path" + TransPathFlag = "path" TransPathUsage = "the path of the file to import from/export to" ) diff --git a/internal/trans/importer.go b/internal/trans/importer.go index c37d76adc..4917cf3d3 100644 --- a/internal/trans/importer.go +++ b/internal/trans/importer.go @@ -36,7 +36,7 @@ type importer struct { func NewImporter(db db.DB, log *logrus.Logger) Importer { return &importer{ - db: db, - log: log, + db: db, + log: log, } } diff --git a/internal/trans/model/block.go b/internal/trans/model/block.go index 781eaa2a2..34b6cabc8 100644 --- a/internal/trans/model/block.go +++ b/internal/trans/model/block.go @@ -21,10 +21,10 @@ package trans import "time" type Block struct { - Type TransType `json:"type" bun:"-"` - ID string `json:"id"` + Type TransType `json:"type" bun:"-"` + ID string `json:"id"` CreatedAt *time.Time `json:"createdAt"` - URI string `json:"uri"` - AccountID string `json:"accountId"` - TargetAccountID string `json:"targetAccountId"` + URI string `json:"uri"` + AccountID string `json:"accountId"` + TargetAccountID string `json:"targetAccountId"` } diff --git a/internal/trans/model/follow.go b/internal/trans/model/follow.go index 7f61dc8da..84379c335 100644 --- a/internal/trans/model/follow.go +++ b/internal/trans/model/follow.go @@ -21,10 +21,10 @@ package trans import "time" type Follow struct { - Type TransType `json:"type" bun:"-"` - ID string `json:"id"` + Type TransType `json:"type" bun:"-"` + ID string `json:"id"` CreatedAt *time.Time `json:"createdAt"` - URI string `json:"uri"` - AccountID string `json:"accountId"` - TargetAccountID string `json:"targetAccountId"` + URI string `json:"uri"` + AccountID string `json:"accountId"` + TargetAccountID string `json:"targetAccountId"` } diff --git a/internal/trans/model/followrequest.go b/internal/trans/model/followrequest.go index 3686d7012..f394bdacc 100644 --- a/internal/trans/model/followrequest.go +++ b/internal/trans/model/followrequest.go @@ -21,10 +21,10 @@ package trans import "time" type FollowRequest struct { - Type TransType `json:"type" bun:"-"` - ID string `json:"id"` + Type TransType `json:"type" bun:"-"` + ID string `json:"id"` CreatedAt *time.Time `json:"createdAt"` - URI string `json:"uri"` - AccountID string `json:"accountId"` - TargetAccountID string `json:"targetAccountId"` + URI string `json:"uri"` + AccountID string `json:"accountId"` + TargetAccountID string `json:"targetAccountId"` } diff --git a/internal/trans/model/instance.go b/internal/trans/model/instance.go index 15c4da081..a099161bd 100644 --- a/internal/trans/model/instance.go +++ b/internal/trans/model/instance.go @@ -29,7 +29,7 @@ type Instance struct { Domain string `json:"domain"` Title string `json:"title,omitempty" bun:",nullzero"` URI string `json:"uri"` - SuspendedAt *time.Time `json:"suspendedAt,omitempty" bun:",nullzero"` + SuspendedAt *time.Time `json:"suspendedAt,omitempty" bun:",nullzero"` DomainBlockID string `json:"domainBlockID,omitempty" bun:",nullzero"` ShortDescription string `json:"shortDescription,omitempty" bun:",nullzero"` Description string `json:"description,omitempty" bun:",nullzero"` diff --git a/internal/trans/model/user.go b/internal/trans/model/user.go index 2a39d0d88..c360f872d 100644 --- a/internal/trans/model/user.go +++ b/internal/trans/model/user.go @@ -29,21 +29,21 @@ type User struct { Email string `json:"email,omitempty" bun:",nullzero"` AccountID string `json:"accountID"` EncryptedPassword string `json:"encryptedPassword"` - CurrentSignInAt *time.Time `json:"currentSignInAt,omitempty" bun:",nullzero"` - LastSignInAt *time.Time `json:"lastSignInAt,omitempty" bun:",nullzero"` + CurrentSignInAt *time.Time `json:"currentSignInAt,omitempty" bun:",nullzero"` + LastSignInAt *time.Time `json:"lastSignInAt,omitempty" bun:",nullzero"` InviteID string `json:"inviteID,omitempty" bun:",nullzero"` ChosenLanguages []string `json:"chosenLanguages,omitempty" bun:",nullzero"` FilteredLanguages []string `json:"filteredLanguage,omitempty" bun:",nullzero"` Locale string `json:"locale" bun:",nullzero"` LastEmailedAt time.Time `json:"lastEmailedAt,omitempty" bun:",nullzero"` ConfirmationToken string `json:"confirmationToken,omitempty" bun:",nullzero"` - ConfirmationSentAt *time.Time `json:"confirmationTokenSentAt,omitempty" bun:",nullzero"` - ConfirmedAt *time.Time `json:"confirmedAt,omitempty" bun:",nullzero"` + ConfirmationSentAt *time.Time `json:"confirmationTokenSentAt,omitempty" bun:",nullzero"` + ConfirmedAt *time.Time `json:"confirmedAt,omitempty" bun:",nullzero"` UnconfirmedEmail string `json:"unconfirmedEmail,omitempty" bun:",nullzero"` Moderator bool `json:"moderator"` Admin bool `json:"admin"` Disabled bool `json:"disabled"` Approved bool `json:"approved"` ResetPasswordToken string `json:"resetPasswordToken,omitempty" bun:",nullzero"` - ResetPasswordSentAt *time.Time `json:"resetPasswordSentAt,omitempty" bun:",nullzero"` + ResetPasswordSentAt *time.Time `json:"resetPasswordSentAt,omitempty" bun:",nullzero"` } diff --git a/internal/trans/trans_test.go b/internal/trans/trans_test.go index ae84415eb..4a231486b 100644 --- a/internal/trans/trans_test.go +++ b/internal/trans/trans_test.go @@ -33,7 +33,7 @@ type TransTestSuite struct { func (suite *TransTestSuite) SetupTest() { suite.db = testrig.NewTestDB() - suite.log = testrig.NewTestLog() + suite.log = testrig.NewTestLog() testrig.StandardDBSetup(suite.db, nil) }