Skip to content

Commit ca98a19

Browse files
authored
Merge pull request #148 from Juneezee/refactor/os.ReadDir
refactor: use `os.ReadDir` for lightweight directory reading
2 parents 216ff7c + 1b68445 commit ca98a19

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

internal/raft/file_snapshot.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"hash"
99
"hash/crc64"
1010
"io"
11-
"io/ioutil"
1211
"log"
1312
"os"
1413
"path/filepath"
@@ -214,7 +213,7 @@ func (f *FileSnapshotStore) List() ([]*SnapshotMeta, error) {
214213
// getSnapshots returns all the known snapshots.
215214
func (f *FileSnapshotStore) getSnapshots() ([]*fileSnapshotMeta, error) {
216215
// Get the eligible snapshots
217-
snapshots, err := ioutil.ReadDir(f.path)
216+
snapshots, err := os.ReadDir(f.path)
218217
if err != nil {
219218
f.logger.Printf("[ERR] snapshot: Failed to scan snapshot dir: %v", err)
220219
return nil, err

script/bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
readonly supportedGo="go1.1[567]"
5+
readonly supportedGo="go1.1[67]"
66

77
# Ensure go is installed
88
if ! command -v go ; then

0 commit comments

Comments
 (0)