chore: remove refs to deprecated io/ioutil (#2717)

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
guangwu
2023-10-16 10:23:50 +08:00
committed by GitHub
parent b617c97342
commit 39d2f293c6
7 changed files with 10 additions and 15 deletions
+1 -2
View File
@@ -2,7 +2,6 @@ package helpers
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
@@ -10,7 +9,7 @@ import (
// ReadDir finds files according to extensions in the dir
func ReadDir(dir string, extensions []string) ([]string, error) {
confs, err := ioutil.ReadDir(dir)
confs, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
+1 -2
View File
@@ -2,7 +2,6 @@ package commands
import (
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
@@ -113,7 +112,7 @@ func dirExists(file string) bool {
}
func readConfDir(dirPath string, extension []string) cmdarg.Arg {
confs, err := ioutil.ReadDir(dirPath)
confs, err := os.ReadDir(dirPath)
if err != nil {
base.Fatalf("failed to read dir %s: %s", dirPath, err)
}