1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Use Set type (#388)

* Use util.Set type.

* Caught another set usage.
This commit is contained in:
Sascha L. Teichmann 2023-07-04 13:00:01 +02:00 committed by GitHub
parent be3dfcd542
commit 8032d47b50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 40 deletions

View file

@ -40,13 +40,13 @@ type worker struct {
expr *util.PathEval
signRing *crypto.KeyRing
client util.Client // client per provider
provider *provider // current provider
metadataProvider any // current metadata provider
loc string // URL of current provider-metadata.json
dir string // Directory to store data to.
summaries map[string][]summary // the summaries of the advisories.
categories map[string]map[string]bool // the categories per label.
client util.Client // client per provider
provider *provider // current provider
metadataProvider any // current metadata provider
loc string // URL of current provider-metadata.json
dir string // Directory to store data to.
summaries map[string][]summary // the summaries of the advisories.
categories map[string]util.Set[string] // the categories per label.
}
func newWorker(num int, processor *processor) *worker {
@ -104,9 +104,9 @@ func (w *worker) locateProviderMetadata(domain string) error {
// removeOrphans removes the directories that are not in the providers list.
func (p *processor) removeOrphans() error {
keep := make(map[string]bool)
keep := util.Set[string]{}
for _, p := range p.cfg.Providers {
keep[p.Name] = true
keep.Add(p.Name)
}
path := filepath.Join(p.cfg.Web, ".well-known", "csaf-aggregator")
@ -134,7 +134,7 @@ func (p *processor) removeOrphans() error {
}
for _, entry := range entries {
if keep[entry.Name()] {
if keep.Contains(entry.Name()) {
continue
}