From 4bc43d2741fa4904e51fc5da71d15b804c556c43 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Wed, 9 Mar 2022 22:48:00 +0100 Subject: all: fix minor issues found by staticcheck Signed-off-by: Moritz Poldrack --- widgets/aerc.go | 3 --- widgets/compose.go | 1 - widgets/msgviewer.go | 5 +---- widgets/terminal.go | 4 ++-- 4 files changed, 3 insertions(+), 10 deletions(-) (limited to 'widgets') diff --git a/widgets/aerc.go b/widgets/aerc.go index 98bc1b23..8061f388 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -598,13 +598,11 @@ func (aerc *Aerc) AddDialog(d ui.DrawableInteractive) { aerc.Invalidate() }) aerc.Invalidate() - return } func (aerc *Aerc) CloseDialog() { aerc.dialog = nil aerc.Invalidate() - return } func (aerc *Aerc) GetPassword(title string, prompt string) (chText chan string, chErr chan error) { @@ -622,7 +620,6 @@ func (aerc *Aerc) GetPassword(title string, prompt string) (chText chan string, } chErr <- nil chText <- pw - return }) aerc.AddDialog(getPasswd) diff --git a/widgets/compose.go b/widgets/compose.go index e47aa3eb..977c4c43 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -876,7 +876,6 @@ func (he *headerEditor) storeValue() { // fix the issue he.header.SetText(he.name, val) } - val = format.FormatAddresses(list) default: he.header.SetText(he.name, val) } diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index dba2bc6d..da81ec95 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -54,10 +54,7 @@ func NewMessageViewer(acct *AccountView, hf := HeaderLayoutFilter{ layout: HeaderLayout(conf.Viewer.HeaderLayout), keep: func(msg *models.MessageInfo, header string) bool { - if fmtHeader(msg, header, "2") != "" { - return true - } - return false + return fmtHeader(msg, header, "2") != "" }, } layout := hf.forMessage(msg.MessageInfo()) diff --git a/widgets/terminal.go b/widgets/terminal.go index b6e8fc0e..a9c79884 100644 --- a/widgets/terminal.go +++ b/widgets/terminal.go @@ -134,7 +134,7 @@ func NewTerminal(cmd *exec.Cmd) (*Terminal, error) { return } term.writeMutex.Lock() - n, err = term.vterm.Write(buf[:n]) + _, err = term.vterm.Write(buf[:n]) term.writeMutex.Unlock() if err != nil { term.Close(err) @@ -166,7 +166,7 @@ func (term *Terminal) flushTerminal() { if n == 0 { break } - n, err = term.pty.Write(buf[:n]) + _, err = term.pty.Write(buf[:n]) if err != nil { term.Close(err) return -- cgit