Skip to content

Commit dd621a7

Browse files
committed
Remove deprecated calls to ioutil.*
1 parent 08cf9b4 commit dd621a7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

constructors.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
package paths
3131

3232
import (
33-
"io/ioutil"
3433
"os"
3534
"runtime"
3635
)
@@ -53,7 +52,7 @@ func TempDir() *Path {
5352
// the new directory. If dir is the empty string, TempDir uses the
5453
// default directory for temporary files
5554
func MkTempDir(dir, prefix string) (*Path, error) {
56-
path, err := ioutil.TempDir(dir, prefix)
55+
path, err := os.MkdirTemp(dir, prefix)
5756
if err != nil {
5857
return nil, err
5958
}
@@ -70,7 +69,7 @@ func MkTempFile(dir *Path, prefix string) (*os.File, error) {
7069
if dir != nil {
7170
tmpDir = dir.String()
7271
}
73-
return ioutil.TempFile(tmpDir, prefix)
72+
return os.CreateTemp(tmpDir, prefix)
7473
}
7574

7675
// Getwd returns a rooted path name corresponding to the current

0 commit comments

Comments
 (0)