From 0659868ece9b923bf513fd174684711606e6e03a Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 27 Oct 2023 15:19:48 +0800 Subject: [PATCH] chore: remove refs to deprecated io/ioutil --- fsql_test.go | 3 +-- transform/common.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fsql_test.go b/fsql_test.go index b7fda06..2433eb6 100644 --- a/fsql_test.go +++ b/fsql_test.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "os" "path/filepath" "reflect" @@ -361,7 +360,7 @@ func GetAttrs(path string, attrs ...string) []string { // elegant solution when we introduce new modifiers in the future. switch attr { case "hash": - b, err := ioutil.ReadFile(path) + b, err := os.ReadFile(path) if err != nil { return []string{} } diff --git a/transform/common.go b/transform/common.go index 50da3f4..fe13d0d 100644 --- a/transform/common.go +++ b/transform/common.go @@ -4,7 +4,6 @@ import ( "crypto/sha1" "encoding/hex" "hash" - "io/ioutil" "os" "path/filepath" "strings" @@ -72,7 +71,7 @@ func ComputeHash(info os.FileInfo, path string, h hash.Hash) (interface{}, error return fallback, nil } - b, err := ioutil.ReadFile(path) + b, err := os.ReadFile(path) if err != nil { return nil, err }