From 8ea86cea41aa038a25a8fee9cd540a7336869dae Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 30 Jan 2021 13:51:32 +0100 Subject: Get rid of the aerc.PushError(" " + $string) idiom The individual callers should not be responsible for padding --- commands/compose/attach.go | 4 ++-- commands/compose/postpone.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'commands/compose') diff --git a/commands/compose/attach.go b/commands/compose/attach.go index 148442b..37f49df 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -34,13 +34,13 @@ func (Attach) Execute(aerc *widgets.Aerc, args []string) error { path, err := homedir.Expand(path) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) return err } pathinfo, err := os.Stat(path) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(err.Error()) return err } else if pathinfo.IsDir() { aerc.PushError("Attachment must be a file, not a directory") diff --git a/commands/compose/postpone.go b/commands/compose/postpone.go index 365b683..6d6c8e7 100644 --- a/commands/compose/postpone.go +++ b/commands/compose/postpone.go @@ -63,7 +63,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error { go func() { errStr := <-errChan if errStr != "" { - aerc.PushError(" " + errStr) + aerc.PushError(errStr) return } @@ -90,7 +90,7 @@ func (Postpone) Execute(aerc *widgets.Aerc, args []string) error { r.Close() composer.Close() case *types.Error: - aerc.PushError(" " + msg.Error.Error()) + aerc.PushError(msg.Error.Error()) r.Close() composer.Close() } -- cgit v1.2.3