antonmedv / walk

Terminal file manager
MIT License
3.24k stars 88 forks source link

refactor: use `os.ReadDir` for lightweight directory reading #7

Closed Juneezee closed 2 years ago

Juneezee commented 2 years ago

os.ReadDir is a more efficient implementation than ioutil.ReadDir as stated here https://pkg.go.dev/io/ioutil#ReadDir.

Note: os.ReadDir was added in Go 1.16 as part of the deprecation of ioutil package. You can read the proposal here https://github.com/golang/go/issues/41467