From dd621a7f2e60cabb30e0806a19a2dbf21d2cf535 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Fri, 30 May 2025 11:04:50 +0200 Subject: [PATCH] Remove deprecated calls to ioutil.* --- constructors.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/constructors.go b/constructors.go index 953aee3..edd2112 100644 --- a/constructors.go +++ b/constructors.go @@ -30,7 +30,6 @@ package paths import ( - "io/ioutil" "os" "runtime" ) @@ -53,7 +52,7 @@ func TempDir() *Path { // the new directory. If dir is the empty string, TempDir uses the // default directory for temporary files func MkTempDir(dir, prefix string) (*Path, error) { - path, err := ioutil.TempDir(dir, prefix) + path, err := os.MkdirTemp(dir, prefix) if err != nil { return nil, err } @@ -70,7 +69,7 @@ func MkTempFile(dir *Path, prefix string) (*os.File, error) { if dir != nil { tmpDir = dir.String() } - return ioutil.TempFile(tmpDir, prefix) + return os.CreateTemp(tmpDir, prefix) } // Getwd returns a rooted path name corresponding to the current