Browse Source

fix: switch away from ioutil

Shelikhoo 4 years ago
parent
commit
82e730bb70

+ 0 - 1
app/dns/nameserver_doh.go

@@ -8,7 +8,6 @@ import (
 	"context"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"net/http"
 	"net/url"
 	"sync"

+ 2 - 2
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
 	}

+ 0 - 1
common/drain/drainer.go

@@ -2,7 +2,6 @@ package drain
 
 import (
 	"io"
-	"io/ioutil"
 
 	"github.com/v2fly/v2ray-core/v4/common/dice"
 )

+ 0 - 1
infra/conf/mergers/merge.go

@@ -2,7 +2,6 @@ package mergers
 
 import (
 	"io"
-	"io/ioutil"
 	"path/filepath"
 	"strings"
 

+ 0 - 1
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"