From b7d6540d5194d9a2a11635dabcbb908664fd99a7 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Sun, 14 Apr 2024 12:46:24 +0200 Subject: [PATCH] style nit: only take address of structs when passed on --- ctl.go | 4 ++-- queue/dsn.go | 4 ++-- serve_unix.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ctl.go b/ctl.go index fefcf7c..15e50a5 100644 --- a/ctl.go +++ b/ctl.go @@ -336,13 +336,13 @@ func servectlcmd(ctx context.Context, ctl *ctl, shutdown func()) { err = msgFile.Sync() ctl.xcheck(err, "syncing message to storage") - m := &store.Message{ + m := store.Message{ Received: time.Now(), Size: mw.Size, } a.WithWLock(func() { - err := a.DeliverDestination(log, addr, m, msgFile) + err := a.DeliverDestination(log, addr, &m, msgFile) ctl.xcheck(err, "delivering message") log.Info("message delivered through ctl", slog.Any("to", to)) }) diff --git a/queue/dsn.go b/queue/dsn.go index 2c1f46d..eef9c95 100644 --- a/queue/dsn.go +++ b/queue/dsn.go @@ -276,7 +276,7 @@ func deliverDSN(ctx context.Context, log mlog.Log, m Msg, remoteMTA dsn.NameIP, return } - msg := &store.Message{ + msg := store.Message{ Received: time.Now(), Size: msgWriter.Size, MsgPrefix: []byte{}, @@ -294,7 +294,7 @@ func deliverDSN(ctx context.Context, log mlog.Log, m Msg, remoteMTA dsn.NameIP, } acc.WithWLock(func() { - if err := acc.DeliverMailbox(log, mailbox, msg, msgFile); err != nil { + if err := acc.DeliverMailbox(log, mailbox, &msg, msgFile); err != nil { qlog("delivering dsn to mailbox", err) return } diff --git a/serve_unix.go b/serve_unix.go index ef27911..0b34fbb 100644 --- a/serve_unix.go +++ b/serve_unix.go @@ -325,7 +325,7 @@ Only implemented on unix systems, not Windows. } defer store.CloseRemoveTempFile(log, f, "message for changelog delivery") - m := &store.Message{ + m := store.Message{ Received: time.Now(), Flags: store.Flags{Flagged: true}, } @@ -335,7 +335,7 @@ Only implemented on unix systems, not Windows. return next } m.Size = int64(n) - if err := a.DeliverMailbox(log, mox.Conf.Static.Postmaster.Mailbox, m, f); err != nil { + if err := a.DeliverMailbox(log, mox.Conf.Static.Postmaster.Mailbox, &m, f); err != nil { log.Errorx("changelog delivery", err) return next }