diff options
author | Moritz Poldrack <git@moritz.sh> | 2022-07-29 21:25:56 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-08-04 21:57:50 +0200 |
commit | 03f9f4c3ab633f3b567813b55b90ba9aac604e3e (patch) | |
tree | ee90524b9921f0f4d5b6c3b92b9a7ed554466fe0 /widgets | |
parent | 2534612c5929782f4bf9f27df65d1d024d6947ca (diff) | |
download | aerc-03f9f4c3ab633f3b567813b55b90ba9aac604e3e.tar.gz |
lint: remove ineffectual assignments (ineffassign)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/authinfo.go | 5 | ||||
-rw-r--r-- | widgets/dirtree.go | 3 | ||||
-rw-r--r-- | widgets/pgpinfo.go | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/widgets/authinfo.go b/widgets/authinfo.go index 878a0c3c..e773240e 100644 --- a/widgets/authinfo.go +++ b/widgets/authinfo.go @@ -23,14 +23,13 @@ func NewAuthInfo(auth *auth.Details, showInfo bool, uiConfig *config.UIConfig) * func (a *AuthInfo) Draw(ctx *ui.Context) { defaultStyle := a.uiConfig.GetStyle(config.STYLE_DEFAULT) - style := a.uiConfig.GetStyle(config.STYLE_DEFAULT) ctx.Fill(0, 0, ctx.Width(), ctx.Height(), ' ', defaultStyle) var text string if a.authdetails == nil { text = "(no header)" ctx.Printf(0, 0, defaultStyle, text) } else if a.authdetails.Err != nil { - style = a.uiConfig.GetStyle(config.STYLE_ERROR) + style := a.uiConfig.GetStyle(config.STYLE_ERROR) text = a.authdetails.Err.Error() ctx.Printf(0, 0, style, text) } else { @@ -81,7 +80,7 @@ func (a *AuthInfo) Draw(ctx *ui.Context) { if checkBounds(x) && infoText != "" { if trunc := ctx.Width() - x - 3; trunc > 0 { text = runewidth.Truncate(infoText, trunc, "…") - x += ctx.Printf(x, 0, defaultStyle, fmt.Sprintf(" (%s)", text)) + ctx.Printf(x, 0, defaultStyle, fmt.Sprintf(" (%s)", text)) } } } diff --git a/widgets/dirtree.go b/widgets/dirtree.go index e5404343..f135a0c3 100644 --- a/widgets/dirtree.go +++ b/widgets/dirtree.go @@ -375,9 +375,6 @@ func buildTree(node *types.Thread, stree [][]string, defaultUid uint32) { for _, branch := range stree { if len(branch) > 1 { var next [][]string - if _, ok := m[branch[0]]; !ok { - next = make([][]string, 0) - } next = append(m[branch[0]], branch[1:]) m[branch[0]] = next } diff --git a/widgets/pgpinfo.go b/widgets/pgpinfo.go index 3dd3fbb7..ee2a0266 100644 --- a/widgets/pgpinfo.go +++ b/widgets/pgpinfo.go @@ -71,7 +71,7 @@ func (p *PGPInfo) DrawEncryption(ctx *ui.Context, y int) { x := ctx.Printf(0, y, validStyle, "%s Encrypted", icon) x += ctx.Printf(x+1, y, defaultStyle, "To %s (%8X) ", p.details.DecryptedWith, p.details.DecryptedWithKeyId) if !p.details.IsSigned { - x += ctx.Printf(x, y, warningStyle, "(message not signed!)") + ctx.Printf(x, y, warningStyle, "(message not signed!)") } } |