mirror of
https://github.com/restic/restic.git
synced 2024-12-22 07:43:03 +00:00
Replace usages of ioutil.ReadDir
This changes the return type to []fs.DirEntry. However, as we only use the filenames anyways, this doesn't make a difference.
This commit is contained in:
parent
ff7ef5007e
commit
f755233210
3 changed files with 3 additions and 6 deletions
|
@ -6,7 +6,6 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"syscall"
|
||||
|
@ -57,7 +56,7 @@ func nlink(info os.FileInfo) uint64 {
|
|||
func createFileSetPerHardlink(dir string) map[uint64][]string {
|
||||
var stat syscall.Stat_t
|
||||
linkTests := make(map[uint64][]string)
|
||||
files, err := ioutil.ReadDir(dir)
|
||||
files, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
@ -39,7 +38,7 @@ func inode(info os.FileInfo) uint64 {
|
|||
|
||||
func createFileSetPerHardlink(dir string) map[uint64][]string {
|
||||
linkTests := make(map[uint64][]string)
|
||||
files, err := ioutil.ReadDir(dir)
|
||||
files, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
|
@ -366,7 +365,7 @@ func runBuild(sourceDir, outputDir, version string) {
|
|||
}
|
||||
|
||||
func readdir(dir string) []string {
|
||||
fis, err := ioutil.ReadDir(dir)
|
||||
fis, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
die("readdir %v failed: %v", dir, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue