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:
parent
12815430ec
commit
4dfa2dd552
1 changed files with 11 additions and 10 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue