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

@ -46,7 +46,7 @@ type processor struct {
ageAccept func(time.Time) bool
redirects map[string][]string
noneTLS map[string]struct{}
noneTLS util.Set[string]
alreadyChecked map[string]whereType
pmdURL string
pmd256 []byte
@ -369,10 +369,10 @@ func (p *processor) checkDomain(domain string) error {
// the value of "noneTLS" field if it is not HTTPS.
func (p *processor) checkTLS(u string) {
if p.noneTLS == nil {
p.noneTLS = map[string]struct{}{}
p.noneTLS = util.Set[string]{}
}
if x, err := url.Parse(u); err == nil && x.Scheme != "https" {
p.noneTLS[u] = struct{}{}
p.noneTLS.Add(u)
}
}
@ -1163,7 +1163,7 @@ func (p *processor) checkListing(string) error {
var unlisted []string
badDirs := map[string]struct{}{}
badDirs := util.Set[string]{}
if len(p.alreadyChecked) == 0 {
p.badDirListings.info("No directory listings found.")