mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
chore: remove refs to deprecated io/ioutil (#2717)
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user