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
2016-03-07 19:02:36 -08:00
parent 114f9de5eb
commit a5d0bef4e2
2 changed files with 75 additions and 1 deletions

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{