~sircmpwn/aerc

8b4f2d148c8519326f306fd14ba872d7cb3101c6 — Reto Brunner 2 years ago fda424b
Fix linter warnings

* Remove redundant return (code was never reached)
* Remove redundant type information
* Rename unused function parameters to "_"
4 files changed, 8 insertions(+), 9 deletions(-)

M commands/msg/delete.go
M commands/msg/forward.go
M commands/msg/unsubscribe_test.go
M lib/msgstore.go
M commands/msg/delete.go => commands/msg/delete.go +0 -1
@@ 97,7 97,6 @@ func findNextNonDeleted(deleted []uint32, store *lib.MessageStore) *models.Messa
		}
		return next
	}
	return nil // Never reached
}

func contains(uids []uint32, uid uint32) bool {

M commands/msg/forward.go => commands/msg/forward.go +1 -1
@@ 132,7 132,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
				return
			}
			composer.AddAttachment(tmpFileName)
			composer.OnClose(func(composer *widgets.Composer) {
			composer.OnClose(func(_ *widgets.Composer) {
				os.RemoveAll(tmpDir)
			})
		})

M commands/msg/unsubscribe_test.go => commands/msg/unsubscribe_test.go +6 -6
@@ 10,19 10,19 @@ func TestParseUnsubscribe(t *testing.T) {
		expected []string
	}
	cases := []*tc{
		&tc{"", []string{}},
		&tc{"invalid", []string{}},
		&tc{"<https://example.com>, <http://example.com>", []string{
		{"", []string{}},
		{"invalid", []string{}},
		{"<https://example.com>, <http://example.com>", []string{
			"https://example.com", "http://example.com",
		}},
		&tc{"<https://example.com> is a URL", []string{
		{"<https://example.com> is a URL", []string{
			"https://example.com",
		}},
		&tc{"<mailto:user@host?subject=unsubscribe>, <https://example.com>",
		{"<mailto:user@host?subject=unsubscribe>, <https://example.com>",
			[]string{
				"mailto:user@host?subject=unsubscribe", "https://example.com",
			}},
		&tc{"<>, <https://example> ", []string{
		{"<>, <https://example> ", []string{
			"", "https://example",
		}},
	}

M lib/msgstore.go => lib/msgstore.go +1 -1
@@ 594,7 594,7 @@ func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func()) {
	store.Sorting = true
	store.worker.PostAction(&types.FetchDirectoryContents{
		SortCriteria: criteria,
	}, func(msg types.WorkerMessage) {
	}, func(_ types.WorkerMessage) {
		store.Sorting = false
		if cb != nil {
			cb()