aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/authinfo.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-07-29 21:25:56 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-04 21:57:50 +0200
commit03f9f4c3ab633f3b567813b55b90ba9aac604e3e (patch)
treeee90524b9921f0f4d5b6c3b92b9a7ed554466fe0 /widgets/authinfo.go
parent2534612c5929782f4bf9f27df65d1d024d6947ca (diff)
downloadaerc-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/authinfo.go')
-rw-r--r--widgets/authinfo.go5
1 files changed, 2 insertions, 3 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))
}
}
}