mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-01 15:08:33 +00:00
Remove 99% of deprecated ioutil usage
Signed-off-by: David Gageot <david.gageot@docker.com>
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -74,13 +73,13 @@ func main() {
|
||||
}
|
||||
defer syscall.Unmount(mount, 0)
|
||||
|
||||
files, err := ioutil.ReadDir(dir)
|
||||
files, err := os.ReadDir(dir)
|
||||
if err != nil {
|
||||
log.Fatalf("Cannot read directory %s: %s", dir, err)
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
contents, err := ioutil.ReadFile(filepath.Join(dir, file.Name()))
|
||||
contents, err := os.ReadFile(filepath.Join(dir, file.Name()))
|
||||
if err != nil {
|
||||
log.Fatalf("Cannot read file %s: %s", file.Name(), err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user