pkg/fs: test, bench, and drop unnecessary check in ListBuckets

There is now a simple test and a benchmark for ListBuckets. I also
dropped an unnecessary check that was simply repeated from above,
guaranteed to be true.
This commit is contained in:
Brendan Ashworth committed 2016-03-07 19:58:33 -08:00
1 parent 114f9de5eb
commit a5d0bef4e2
2 files changed
+75 -1

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ func (fs Filesystem) ListBuckets() ([]BucketMetadata, *probe.Error) {
}
// If directories are found with odd names, skip them.
dirName := strings.ToLower(file.Name())
if file.IsDir() && !IsValidBucketName(dirName) {
if !IsValidBucketName(dirName) {
continue
}
metadata := BucketMetadata{