style nit: only take address of structs when passed on

This commit is contained in:
Mechiel Lukkien 2024-04-14 12:46:24 +02:00
parent 2a949f9f79
commit b7d6540d51
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

4
ctl.go
View file

@ -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))
})

View file

@ -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
}

View file

@ -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
}