remove ioutil usage in all project

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2022-04-03 15:53:19 +08:00
parent 1aa87538a7
commit 303ef9cd80
14 changed files with 28 additions and 38 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ package main
import (
"fmt"
"io/ioutil"
"io"
"os"
"strings"
@@ -79,9 +79,9 @@ func unmarshal(filename string) (interface{}, error) {
var contents []byte
var err error
if filename == "-" {
contents, err = ioutil.ReadAll(os.Stdin)
contents, err = io.ReadAll(os.Stdin)
} else {
contents, err = ioutil.ReadFile(filename)
contents, err = os.ReadFile(filename)
}
if err != nil {
return nil, err