diff --git a/doublestar.go b/doublestar.go
index <HASH>..<HASH> 100644
--- a/doublestar.go
+++ b/doublestar.go
@@ -436,7 +436,10 @@ func doGlob(vos OS, basedir, pattern string, matches []string) (m []string, e er
 	}
 	defer dir.Close()
 
-	files, _ := dir.Readdir(-1)
+	files, err := dir.Readdir(-1)
+	if err != nil {
+		return nil, err
+	}
 	sort.Slice(files, func(i, j int) bool { return files[i].Name() < files[j].Name() })
 
 	slashIdx := indexRuneWithEscaping(pattern, '/')
don't ignore errors from Readdir