1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 18:15:42 +01:00

Dedup code a bit

This commit is contained in:
Sascha L. Teichmann 2023-08-23 17:14:49 +02:00
parent 12815430ec
commit 4dfa2dd552

View file

@ -1131,18 +1131,19 @@ func (p *processor) checkMissing(string) error {
} }
} }
// List error in all appropriate categories // List error in all appropriate categories
if mistake&rolieMask != 0 { if mistake&(rolieMask|indexMask|changesMask|listingMask) == 0 {
p.badROLIEFeed.error("%s %s", f, strings.Join(where, ", ")) continue
} }
if mistake&indexMask != 0 { joined := strings.Join(where, ", ")
p.badIndices.error("%s %s", f, strings.Join(where, ", ")) report := func(mask whereType, msgs *topicMessages) {
} if mistake&mask != 0 {
if mistake&changesMask != 0 { msgs.error("%s %s", f, joined)
p.badChanges.error("%s %s", f, strings.Join(where, ", ")) }
}
if mistake&listingMask != 0 {
p.badDirListings.error("%s %s", f, strings.Join(where, ", "))
} }
report(rolieMask, &p.badROLIEFeed)
report(indexMask, &p.badIndices)
report(changesMask, &p.badChanges)
report(listingMask, &p.badDirListings)
} }
return nil return nil
} }