From 0029bddda635fede84eb65940251108217209a6a Mon Sep 17 00:00:00 2001 From: adranwit Date: Sat, 16 Mar 2024 14:27:05 -0700 Subject: [PATCH] upgraded deprecated call --- modifier/replacer.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modifier/replacer.go b/modifier/replacer.go index 9059d08..fa6553a 100644 --- a/modifier/replacer.go +++ b/modifier/replacer.go @@ -4,15 +4,14 @@ import ( "github.com/viant/afs/file" "github.com/viant/afs/option" "io" - "io/ioutil" "os" "strings" ) -//Replace return modification handler with the specified replacements map +// Replace return modification handler with the specified replacements map func Replace(replacements map[string]string) option.Modifier { return func(_ string, info os.FileInfo, reader io.ReadCloser) (os.FileInfo, io.ReadCloser, error) { - data, err := ioutil.ReadAll(reader) + data, err := io.ReadAll(reader) if err != nil { return nil, nil, err } @@ -24,6 +23,6 @@ func Replace(replacements map[string]string) option.Modifier { } } info = file.AdjustInfoSize(info, len(text)) - return info, ioutil.NopCloser(strings.NewReader(text)), nil + return info, io.NopCloser(strings.NewReader(text)), nil } }