Merge pull request #299 from alexei-led/master

fix error when scanning folders for feteched update for Alpine vulnerabilities
This commit is contained in:
Jimmy Zelinskie 2016-12-30 12:48:29 -05:00 committed by GitHub
commit 7106f1c524

View File

@ -115,19 +115,22 @@ func detectNamespaces(path string) ([]string, error) {
defer dir.Close() defer dir.Close()
// Get a list of the namspaces from the directory names. // Get a list of the namspaces from the directory names.
names, err := dir.Readdirnames(0) finfos, err := dir.Readdir(0)
if err != nil { if err != nil {
return nil, err return nil, err
} }
var namespaces []string var namespaces []string
for _, name := range names { for _, info := range finfos {
if !info.IsDir() {
continue
}
// Filter out hidden directories like `.git`. // Filter out hidden directories like `.git`.
if strings.HasPrefix(name, ".") { if strings.HasPrefix(info.Name(), ".") {
continue continue
} }
namespaces = append(namespaces, name) namespaces = append(namespaces, info.Name())
} }
return namespaces, nil return namespaces, nil