From 3f546e8b32eabf8f1dfa931f305e5d9fa9acefb3 Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Tue, 29 Jun 2021 16:31:11 +0200 Subject: [PATCH] go fmt --- internal/processing/account/delete.go | 40 ++++++++++++------------ internal/processing/account/get.go | 16 +++++----- internal/processing/admin/admin.go | 10 +++--- internal/processing/admin/domainblock.go | 6 ++-- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/internal/processing/account/delete.go b/internal/processing/account/delete.go index b33923090..9dfccd1be 100644 --- a/internal/processing/account/delete.go +++ b/internal/processing/account/delete.go @@ -21,25 +21,25 @@ package account import "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" func (p *processor) Delete(account *gtsmodel.Account) error { - // TODO in this function: - // 1. Delete account's application(s), clients, and oauth tokens - // 2. Delete account's blocks - // 3. Delete account's emoji - // 4. Delete account's follow requests - // 5. Delete account's follows - // 6. Delete account's follow requests - // 7. Delete account's media attachments - // 8. Delete account's mentions - // 9. Delete account's notifications - // 10. Delete account's polls - // 11. Delete account's statuses - // 12. Delete account's bookmarks - // 13. Delete account's faves - // 14. Delete account's mutes - // 15. Delete account's streams - // 16. Delete account's tags - // 17. Delete account's user - // 18. Delete account's timeline + // TODO in this function: + // 1. Delete account's application(s), clients, and oauth tokens + // 2. Delete account's blocks + // 3. Delete account's emoji + // 4. Delete account's follow requests + // 5. Delete account's follows + // 6. Delete account's follow requests + // 7. Delete account's media attachments + // 8. Delete account's mentions + // 9. Delete account's notifications + // 10. Delete account's polls + // 11. Delete account's statuses + // 12. Delete account's bookmarks + // 13. Delete account's faves + // 14. Delete account's mutes + // 15. Delete account's streams + // 16. Delete account's tags + // 17. Delete account's user + // 18. Delete account's timeline - return nil + return nil } diff --git a/internal/processing/account/get.go b/internal/processing/account/get.go index 686361dfa..aba1ed14a 100644 --- a/internal/processing/account/get.go +++ b/internal/processing/account/get.go @@ -36,14 +36,14 @@ func (p *processor) Get(requestingAccount *gtsmodel.Account, targetAccountID str return nil, fmt.Errorf("db error: %s", err) } - // lazily dereference things on the account if it hasn't been done yet - var requestingUsername string - if requestingAccount != nil { - requestingUsername = requestingAccount.Username - } - if err := p.federator.DereferenceAccountFields(targetAccount, requestingUsername, false); err != nil { - p.log.WithField("func", "AccountGet").Debugf("dereferencing account: %s", err) - } + // lazily dereference things on the account if it hasn't been done yet + var requestingUsername string + if requestingAccount != nil { + requestingUsername = requestingAccount.Username + } + if err := p.federator.DereferenceAccountFields(targetAccount, requestingUsername, false); err != nil { + p.log.WithField("func", "AccountGet").Debugf("dereferencing account: %s", err) + } var mastoAccount *apimodel.Account var err error diff --git a/internal/processing/admin/admin.go b/internal/processing/admin/admin.go index 9c23e38a3..5f42ff820 100644 --- a/internal/processing/admin/admin.go +++ b/internal/processing/admin/admin.go @@ -47,11 +47,11 @@ type processor struct { // New returns a new admin processor. func New(db db.DB, tc typeutils.TypeConverter, mediaHandler media.Handler, fromClientAPI chan gtsmodel.FromClientAPI, config *config.Config, log *logrus.Logger) Processor { return &processor{ - tc: tc, - config: config, - mediaHandler: mediaHandler, + tc: tc, + config: config, + mediaHandler: mediaHandler, fromClientAPI: fromClientAPI, - db: db, - log: log, + db: db, + log: log, } } diff --git a/internal/processing/admin/domainblock.go b/internal/processing/admin/domainblock.go index 4a8069b29..686474032 100644 --- a/internal/processing/admin/domainblock.go +++ b/internal/processing/admin/domainblock.go @@ -116,10 +116,10 @@ func (p *processor) initiateDomainBlockSideEffects(block *gtsmodel.DomainBlock) // delete accounts through the normal account deletion system (which should also delete media + posts + remove posts from timelines) - limit := 20 // just select 20 accounts at a time so we don't nuke our DB/mem with one huge query + limit := 20 // just select 20 accounts at a time so we don't nuke our DB/mem with one huge query var maxID string // this is initially an empty string so we'll start at the top of accounts list (sorted by ID) - selectAccountsLoop: +selectAccountsLoop: for { accounts, err := p.db.GetAccountsForInstance(block.Domain, maxID, limit) if err != nil { @@ -143,7 +143,7 @@ func (p *processor) initiateDomainBlockSideEffects(block *gtsmodel.DomainBlock) } // if this is the last account in the slice, set the maxID appropriately for the next query - if i == len(accounts) -1 { + if i == len(accounts)-1 { maxID = a.ID } }