aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/authinfo.go5
-rw-r--r--widgets/dirtree.go3
-rw-r--r--widgets/pgpinfo.go2
-rw-r--r--worker/mbox/worker.go2
4 files changed, 4 insertions, 8 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!)")
}
}
diff --git a/worker/mbox/worker.go b/worker/mbox/worker.go
index 6ba886ae..ab16f91e 100644
--- a/worker/mbox/worker.go
+++ b/worker/mbox/worker.go
@@ -50,7 +50,7 @@ func (w *mboxWorker) handleMessage(msg types.WorkerMessage) error {
reterr = err
break
}
- dir := u.Path
+ var dir string
if u.Host == "~" {
home, err := os.UserHomeDir()
if err != nil {