fix error scanning folders for feteched Alpine vulnerabilities
This commit is contained in:
parent
3897fb6706
commit
7ec9225bdc
@ -115,19 +115,22 @@ func detectNamespaces(path string) ([]string, error) {
|
||||
defer dir.Close()
|
||||
|
||||
// Get a list of the namspaces from the directory names.
|
||||
names, err := dir.Readdirnames(0)
|
||||
finfos, err := dir.Readdir(0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var namespaces []string
|
||||
for _, name := range names {
|
||||
for _, info := range finfos {
|
||||
if !info.IsDir() {
|
||||
continue
|
||||
}
|
||||
// Filter out hidden directories like `.git`.
|
||||
if strings.HasPrefix(name, ".") {
|
||||
if strings.HasPrefix(info.Name(), ".") {
|
||||
continue
|
||||
}
|
||||
|
||||
namespaces = append(namespaces, name)
|
||||
namespaces = append(namespaces, info.Name())
|
||||
}
|
||||
|
||||
return namespaces, nil
|
||||
|
Loading…
Reference in New Issue
Block a user