From c882cf9960be691fe55617b87cdfcfbabd5d5557 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Sat, 30 Jul 2022 13:29:46 +0200 Subject: [PATCH] lint: removed unused code (deadcode, structcheck, unused) Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- lib/msgstore.go | 1 - lib/ui/borders.go | 7 +++---- lib/ui/tab.go | 5 ++--- widgets/account-wizard.go | 1 - widgets/common.go | 20 -------------------- widgets/dirlist.go | 1 - worker/imap/idler.go | 1 - worker/notmuch/worker.go | 2 -- 8 files changed, 5 insertions(+), 33 deletions(-) delete mode 100644 widgets/common.go diff --git a/lib/msgstore.go b/lib/msgstore.go index fd67c79..dc000de 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -23,7 +23,6 @@ type MessageStore struct { threads []*types.Thread selectedUid uint32 - reselect *models.MessageInfo bodyCallbacks map[uint32][]func(*types.FullMessage) headerCallbacks map[uint32][]func(*types.MessageInfo) diff --git a/lib/ui/borders.go b/lib/ui/borders.go index 8d381b9..2c68988 100644 --- a/lib/ui/borders.go +++ b/lib/ui/borders.go @@ -15,10 +15,9 @@ const ( type Bordered struct { Invalidatable - borders uint - content Drawable - onInvalidate func(d Drawable) - uiConfig *config.UIConfig + borders uint + content Drawable + uiConfig *config.UIConfig } func NewBordered( diff --git a/lib/ui/tab.go b/lib/ui/tab.go index bcad23c..0c6b3f5 100644 --- a/lib/ui/tab.go +++ b/lib/ui/tab.go @@ -20,17 +20,16 @@ type Tabs struct { uiConfig *config.UIConfig - onInvalidateStrip func(d Drawable) + onInvalidateStrip func(d Drawable) //nolint:structcheck // used within this file onInvalidateContent func(d Drawable) - parent *Tabs + parent *Tabs //nolint:structcheck // used within this file CloseTab func(index int) } type Tab struct { Content Drawable Name string - invalid bool pinned bool indexBeforePin int uiConf *config.UIConfig diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go index 5ed39d5..d7cda2d 100644 --- a/widgets/account-wizard.go +++ b/widgets/account-wizard.go @@ -46,7 +46,6 @@ type AccountWizard struct { steps []*ui.Grid focus int temporary bool - testing bool // CONFIGURE_BASICS accountName *ui.TextInput email *ui.TextInput diff --git a/widgets/common.go b/widgets/common.go deleted file mode 100644 index f77f891..0000000 --- a/widgets/common.go +++ /dev/null @@ -1,20 +0,0 @@ -package widgets - -import ( - "fmt" - - "git.sr.ht/~rjarry/aerc/lib" - "git.sr.ht/~rjarry/aerc/models" -) - -func msgInfoFromUids(store *lib.MessageStore, uids []uint32) ([]*models.MessageInfo, error) { - infos := make([]*models.MessageInfo, len(uids)) - for i, uid := range uids { - var ok bool - infos[i], ok = store.Messages[uid] - if !ok { - return nil, fmt.Errorf("uid not found") - } - } - return infos, nil -} diff --git a/widgets/dirlist.go b/widgets/dirlist.go index e50567e..df4e819 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -59,7 +59,6 @@ type DirectoryList struct { worker *types.Worker skipSelect context.Context skipSelectCancel context.CancelFunc - connected bool uiConf map[string]*config.UIConfig } diff --git a/worker/imap/idler.go b/worker/imap/idler.go index 69fdc4c..a658521 100644 --- a/worker/imap/idler.go +++ b/worker/imap/idler.go @@ -25,7 +25,6 @@ type idler struct { config imapConfig client *imapClient worker *types.Worker - last time.Time stop chan struct{} done chan error waiting bool diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 2c80dbd..dba7857 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -17,7 +17,6 @@ import ( "time" "git.sr.ht/~rjarry/aerc/config" - "git.sr.ht/~rjarry/aerc/lib/uidstore" "git.sr.ht/~rjarry/aerc/logging" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/handlers" @@ -40,7 +39,6 @@ type worker struct { nmEvents chan eventType query string currentQueryName string - uidStore *uidstore.Store queryMapOrder []string nameQueryMap map[string]string db *notmuch.DB