Skip to content
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

chore: replace deprecated ioutil.TempDir with os.MkdirTemp #506

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docker/pkg/ioutils/temp_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils"

import "os"

// TempDir on Unix systems is equivalent to ioutil.TempDir.
// TempDir on Unix systems is equivalent to os.MkdirTemp.
func TempDir(dir, prefix string) (string, error) {
return os.MkdirTemp(dir, prefix)
}
6 changes: 3 additions & 3 deletions docker/pkg/ioutils/temp_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
package ioutils // import "github.com/ory/dockertest/v3/docker/pkg/ioutils"

import (
"io/ioutil"
"os"

"github.com/ory/dockertest/v3/docker/pkg/longpath"
)

// TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format.
// TempDir is the equivalent of os.MkdirTemp, except that the result is in Windows longpath format.
func TempDir(dir, prefix string) (string, error) {
tempDir, err := ioutil.TempDir(dir, prefix)
tempDir, err := os.MkdirTemp(dir, prefix)
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion docker/pkg/system/filesys_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func nextSuffix() string {
return strconv.Itoa(int(1e9 + r%1e9))[1:]
}

// TempFileSequential is a copy of ioutil.TempFile, modified to use sequential
// TempFileSequential is a copy of os.CreateTemp, modified to use sequential
// file access. Below is the original comment from golang:
// TempFile creates a new temporary file in the directory dir
// with a name beginning with prefix, opens the file for reading
Expand Down
Loading