diff options
Diffstat (limited to 'weed/storage/disk_location_ec.go')
| -rw-r--r-- | weed/storage/disk_location_ec.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/weed/storage/disk_location_ec.go b/weed/storage/disk_location_ec.go index 91c7d86a6..3f56d797b 100644 --- a/weed/storage/disk_location_ec.go +++ b/weed/storage/disk_location_ec.go @@ -2,7 +2,6 @@ package storage import ( "fmt" - "io/ioutil" "os" "path" "regexp" @@ -118,25 +117,25 @@ func (l *DiskLocation) loadEcShards(shards []string, collection string, vid need func (l *DiskLocation) loadAllEcShards() (err error) { - fileInfos, err := ioutil.ReadDir(l.Directory) + dirEntries, err := os.ReadDir(l.Directory) if err != nil { return fmt.Errorf("load all ec shards in dir %s: %v", l.Directory, err) } if l.IdxDirectory != l.Directory { - indexFileInfos, err := ioutil.ReadDir(l.IdxDirectory) + indexDirEntries, err := os.ReadDir(l.IdxDirectory) if err != nil { return fmt.Errorf("load all ec shards in dir %s: %v", l.IdxDirectory, err) } - fileInfos = append(fileInfos, indexFileInfos...) + dirEntries = append(dirEntries, indexDirEntries...) } - sort.Slice(fileInfos, func(i, j int) bool { - return fileInfos[i].Name() < fileInfos[j].Name() + sort.Slice(dirEntries, func(i, j int) bool { + return dirEntries[i].Name() < dirEntries[j].Name() }) var sameVolumeShards []string var prevVolumeId needle.VolumeId - for _, fileInfo := range fileInfos { + for _, fileInfo := range dirEntries { if fileInfo.IsDir() { continue } |
