From 82e730bb70c9021133900c27abf3700f4fc80a82 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Tue, 28 Sep 2021 18:12:40 +0100 Subject: [PATCH] fix: switch away from ioutil --- app/dns/nameserver_doh.go | 1 - common/common.go | 4 ++-- common/drain/drainer.go | 1 - infra/conf/mergers/merge.go | 1 - infra/conf/mergers/merger_base.go | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/dns/nameserver_doh.go b/app/dns/nameserver_doh.go index d7ecf66c6..fc6d30588 100644 --- a/app/dns/nameserver_doh.go +++ b/app/dns/nameserver_doh.go @@ -8,7 +8,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net/http" "net/url" "sync" diff --git a/common/common.go b/common/common.go index 035fafc01..edb9e74a6 100644 --- a/common/common.go +++ b/common/common.go @@ -5,7 +5,7 @@ package common import ( "fmt" "go/build" - "io/ioutil" + "io" "net/http" "net/url" "os" @@ -70,7 +70,7 @@ func GetRuntimeEnv(key string) (string, error) { } var data []byte var runtimeEnv string - data, readErr := ioutil.ReadFile(file) + data, readErr := os.ReadFile(file) if readErr != nil { return "", readErr } diff --git a/common/drain/drainer.go b/common/drain/drainer.go index 71c3db221..e92c4363d 100644 --- a/common/drain/drainer.go +++ b/common/drain/drainer.go @@ -2,7 +2,6 @@ package drain import ( "io" - "io/ioutil" "github.com/v2fly/v2ray-core/v4/common/dice" ) diff --git a/infra/conf/mergers/merge.go b/infra/conf/mergers/merge.go index 38c3d323e..c2b041635 100644 --- a/infra/conf/mergers/merge.go +++ b/infra/conf/mergers/merge.go @@ -2,7 +2,6 @@ package mergers import ( "io" - "io/ioutil" "path/filepath" "strings" diff --git a/infra/conf/mergers/merger_base.go b/infra/conf/mergers/merger_base.go index 125a922ab..72a40d0cc 100644 --- a/infra/conf/mergers/merger_base.go +++ b/infra/conf/mergers/merger_base.go @@ -3,7 +3,6 @@ package mergers import ( "fmt" "io" - "io/ioutil" "github.com/v2fly/v2ray-core/v4/common/cmdarg" "github.com/v2fly/v2ray-core/v4/infra/conf/merge"