From d4f6f273bc36d8ce376cd7aee794458011fee2e0 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Fri, 26 Apr 2024 15:24:28 +0800 Subject: chore: remove refs to deprecated io/ioutil Signed-off-by: guoguangwu chore: remove refs to deprecated io/ioutil Signed-off-by: guoguangwu --- commands/input/input.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'commands/input') diff --git a/commands/input/input.go b/commands/input/input.go index 4ccfbd92..90c3cf51 100644 --- a/commands/input/input.go +++ b/commands/input/input.go @@ -8,7 +8,7 @@ import ( "bufio" "bytes" "fmt" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -72,7 +72,7 @@ func LaunchEditor(repo repository.RepoCommonStorage, fileName string) (string, e return "", fmt.Errorf("Editing finished with error: %v\n", err) } - output, err := ioutil.ReadFile(path) + output, err := os.ReadFile(path) if err != nil { return "", fmt.Errorf("Error reading edited file: %v\n", err) @@ -93,7 +93,7 @@ func FromFile(fileName string) (string, error) { } if (stat.Mode() & os.ModeCharDevice) == 0 { // There is no tty. This will allow us to read piped data instead. - output, err := ioutil.ReadAll(os.Stdin) + output, err := io.ReadAll(os.Stdin) if err != nil { return "", fmt.Errorf("Error reading from stdin: %v\n", err) } @@ -110,7 +110,7 @@ func FromFile(fileName string) (string, error) { return output.String(), nil } - output, err := ioutil.ReadFile(fileName) + output, err := os.ReadFile(fileName) if err != nil { return "", fmt.Errorf("Error reading file: %v\n", err) } -- cgit