aboutsummaryrefslogtreecommitdiffstats
path: root/commands/input
diff options
context:
space:
mode:
authorguoguangwu <guoguangwug@gmail.com>2024-04-26 15:24:28 +0800
committersudoforge <no-reply@sudoforge.com>2024-07-23 20:22:15 -0700
commitd4f6f273bc36d8ce376cd7aee794458011fee2e0 (patch)
treebd2f95e167152d7554b10acd29d353370913e6f6 /commands/input
parent1fa858dcf4c4e7b572316705d70c08545abae7ff (diff)
downloadgit-bug-d4f6f273bc36d8ce376cd7aee794458011fee2e0.tar.gz
chore: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwug@gmail.com> chore: remove refs to deprecated io/ioutil Signed-off-by: guoguangwu <guoguangwug@gmail.com>
Diffstat (limited to 'commands/input')
-rw-r--r--commands/input/input.go8
1 files changed, 4 insertions, 4 deletions
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)
}