Skip to content

Commit 2ed1053

Browse files
committed
Stop using deprecated function ioutil.TempDir()
1 parent 8452791 commit 2ed1053

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

git_sizer_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"fmt"
88
"io"
9-
"io/ioutil"
109
"os"
1110
"os/exec"
1211
"path/filepath"
@@ -760,7 +759,7 @@ func TestSubmodule(t *testing.T) {
760759

761760
ctx := context.Background()
762761

763-
tmp, err := ioutil.TempDir("", "submodule")
762+
tmp, err := os.MkdirTemp("", "submodule")
764763
require.NoError(t, err, "creating temporary directory")
765764

766765
defer func() {

internal/testutils/repoutils.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"fmt"
66
"io"
7-
"io/ioutil"
87
"os"
98
"os/exec"
109
"path/filepath"
@@ -29,7 +28,7 @@ type TestRepo struct {
2928
func NewTestRepo(t *testing.T, bare bool, pattern string) *TestRepo {
3029
t.Helper()
3130

32-
path, err := ioutil.TempDir("", pattern)
31+
path, err := os.MkdirTemp("", pattern)
3332
require.NoError(t, err)
3433

3534
repo := TestRepo{Path: path}
@@ -73,7 +72,7 @@ func (repo *TestRepo) Remove(t *testing.T) {
7372
func (repo *TestRepo) Clone(t *testing.T, pattern string) *TestRepo {
7473
t.Helper()
7574

76-
path, err := ioutil.TempDir("", pattern)
75+
path, err := os.MkdirTemp("", pattern)
7776
require.NoError(t, err)
7877

7978
err = repo.GitCommand(

0 commit comments

Comments
 (0)