io/ioutil deprecated (#3217)

This commit is contained in:
guangwu
2023-05-06 17:50:54 +08:00
committed by GitHub
parent 4f13fe8188
commit 63368d8b0c
27 changed files with 85 additions and 89 deletions

View File

@@ -4,8 +4,8 @@ import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
@@ -647,7 +647,7 @@ func NewScanner(filename string, src interface{}) (*Scanner, error) {
}
func readData(filename string, src interface{}) ([]byte, error) {
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err == nil {
return data, nil
}