aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-07-30 13:29:46 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-04 21:58:00 +0200
commitc882cf9960be691fe55617b87cdfcfbabd5d5557 (patch)
tree7446d447a9992f8d761692362ebb66b5e12c1edb
parent5ca6022d007bc83daba1e7297480d37f56554455 (diff)
downloadaerc-c882cf9960be691fe55617b87cdfcfbabd5d5557.tar.gz
lint: removed unused code (deadcode, structcheck, unused)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--lib/msgstore.go1
-rw-r--r--lib/ui/borders.go7
-rw-r--r--lib/ui/tab.go5
-rw-r--r--widgets/account-wizard.go1
-rw-r--r--widgets/common.go20
-rw-r--r--widgets/dirlist.go1
-rw-r--r--worker/imap/idler.go1
-rw-r--r--worker/notmuch/worker.go2
8 files changed, 5 insertions, 33 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index fd67c79c..dc000de7 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 8d381b91..2c689886 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 bcad23c2..0c6b3f5b 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 5ed39d54..d7cda2d8 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 f77f891c..00000000
--- 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 e50567ea..df4e8192 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 69fdc4ca..a658521a 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 2c80dbd4..dba7857d 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