do not use ioutil (#9206)

This commit is contained in:
Jacob Gadikian
2022-08-11 01:35:14 +07:00
committed by GitHub
parent 152a2fa5c9
commit a6dde14ec4
59 changed files with 165 additions and 200 deletions

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
@@ -19,7 +18,7 @@ func WriteConfigVals(dir string, vals map[string]string) error {
data += fmt.Sprintf("%s = \"%s\"\n", k, v)
}
cfile := filepath.Join(dir, "config.toml")
return ioutil.WriteFile(cfile, []byte(data), 0600)
return os.WriteFile(cfile, []byte(data), 0600)
}
// RunWithArgs executes the given command with the specified command line args

View File

@@ -2,7 +2,7 @@ package cli
import (
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
"testing"
@@ -55,7 +55,7 @@ func TestSetupEnv(t *testing.T) {
}
func tempDir() string {
cdir, err := ioutil.TempDir("", "test-cli")
cdir, err := os.MkdirTemp("", "test-cli")
if err != nil {
panic(err)
}