fix warnings by ineffassign, with a one actual issue

In store/search.go, we would make a copy of a byte array, but then still use
the original instead of the copy. Could result in search operations not finding
messages that do have the content, but under very unlikely conditions only.

We'll keep running ineffassign with "make check", useful enough.
This commit is contained in:
Mechiel Lukkien
2025-03-24 10:19:50 +01:00
parent 04b1f030b7
commit 15a8ce8c0b
8 changed files with 15 additions and 15 deletions

View File

@ -1960,11 +1960,12 @@ sharing most of its code.
resolver := dns.StrictResolver{}
var haveMX bool
var origNextHopAuthentic, expandedNextHopAuthentic bool
var expandedNextHopAuthentic bool
var expandedNextHop dns.Domain
var hosts []dns.IPDomain
if len(args) == 1 {
var permanent bool
var origNextHopAuthentic bool
var err error
haveMX, origNextHopAuthentic, expandedNextHopAuthentic, expandedNextHop, hosts, permanent, err = smtpclient.GatherDestinations(ctxbg, c.log.Logger, resolver, dns.IPDomain{Domain: origNextHop})
status := "temporary"
@ -1998,7 +1999,6 @@ sharing most of its code.
d := xparseDomain(args[1], "destination host")
log.Printf("skipping domain mx/cname lookups, assuming domain is dnssec-protected")
origNextHopAuthentic = true
expandedNextHopAuthentic = true
expandedNextHop = d
hosts = []dns.IPDomain{{Domain: d}}