summaryrefslogtreecommitdiffstats
path: root/pkg/commands/oscommands/os.go
diff options
context:
space:
mode:
authorjiepeng <jiepengthegreat@126.com>2022-09-13 18:11:03 +0800
committerJesse Duffield <jessedduffield@gmail.com>2022-09-17 15:10:41 -0700
commitb8900baf1ada72c24e58c487122c21e80858f52a (patch)
tree64c67fecd215d00e540a5d5c2030878b92cff981 /pkg/commands/oscommands/os.go
parentc81333fefe2f1e27ab2fcb6a0dc37d82ca47c711 (diff)
remove deprecated calls
Diffstat (limited to 'pkg/commands/oscommands/os.go')
-rw-r--r--pkg/commands/oscommands/os.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/commands/oscommands/os.go b/pkg/commands/oscommands/os.go
index 2a7cc1328..39149ce84 100644
--- a/pkg/commands/oscommands/os.go
+++ b/pkg/commands/oscommands/os.go
@@ -2,7 +2,7 @@ package oscommands
import (
"fmt"
- "io/ioutil"
+ "io"
"os"
"os/exec"
"path/filepath"
@@ -151,7 +151,7 @@ func (c *OSCommand) CreateFileWithContent(path string, content string) error {
return err
}
- if err := ioutil.WriteFile(path, []byte(content), 0o644); err != nil {
+ if err := os.WriteFile(path, []byte(content), 0o644); err != nil {
c.Log.Error(err)
return utils.WrapError(err)
}
@@ -215,7 +215,7 @@ func (c *OSCommand) PipeCommands(commandStrings ...string) error {
c.Log.Error(err)
}
- if b, err := ioutil.ReadAll(stderr); err == nil {
+ if b, err := io.ReadAll(stderr); err == nil {
if len(b) > 0 {
finalErrors = append(finalErrors, string(b))
}