Skip to content

Remove deprecated calls to ioutil.* #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions constructors.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
package paths

import (
"io/ioutil"
"os"
"runtime"
)
Expand All @@ -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
}
Expand All @@ -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
Expand Down
Loading