io/ioutil deprecated (#3217)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package pathx
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -23,7 +22,7 @@ func TestGetTemplateDir(t *testing.T) {
|
||||
return
|
||||
}
|
||||
tempFile := filepath.Join(dir, "bar.txt")
|
||||
err = ioutil.WriteFile(tempFile, []byte("foo"), os.ModePerm)
|
||||
err = os.WriteFile(tempFile, []byte("foo"), os.ModePerm)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -79,7 +78,7 @@ func TestGetGoctlHome(t *testing.T) {
|
||||
t.Run("goctl_is_file", func(t *testing.T) {
|
||||
tmpFile := filepath.Join(t.TempDir(), "a.tmp")
|
||||
backupTempFile := tmpFile + ".old"
|
||||
err := ioutil.WriteFile(tmpFile, nil, 0o666)
|
||||
err := os.WriteFile(tmpFile, nil, 0o666)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user