diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-10-02 11:36:05 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-02 18:56:26 +0200 |
commit | dc299cc8adda5c9fb7a0f6a7719f3e2cd0f1f443 (patch) | |
tree | 5a3e0ded9d72ae0eafa3440e2ee1c88109d9c21a /commands/msg/forward.go | |
parent | 020279108c4234974a26580183ef60945c5bd5cb (diff) | |
download | aerc-dc299cc8adda5c9fb7a0f6a7719f3e2cd0f1f443.tar.gz |
logging: substitute %w for %v
Subsitute the format specifier %w for %v in the logging facility. The
logging functions use a fmt.Sprintf call behind the scene which does not
recognize %w. %w should be used in fmt.Errorf when you want to wrap
errors. Hence, the log entries that use %w are improperly formatted like
this:
ERROR 2022/10/02 09:13:57.724529 worker.go:439: could not get message
info %!w(*fmt.wrapError=&{could not get structure: [snip] })
^
Links: https://go.dev/blog/go1.13-errors
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'commands/msg/forward.go')
-rw-r--r-- | commands/msg/forward.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go index 040360ea..a3459292 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -143,7 +143,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error { defer tmpFile.Close() _, err = io.Copy(tmpFile, fm.Content.Reader) if err != nil { - logging.Warnf("failed to write to tmpfile: %w", err) + logging.Warnf("failed to write to tmpfile: %v", err) return } composer, err := addTab() |