Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Stop using deprecated function ioutil.TempDir()
  • Loading branch information
mhagger committed Dec 13, 2023
commit 2ed1053ff9d440ec0e405e2f25157e25926633dd
3 changes: 1 addition & 2 deletions git_sizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -760,7 +759,7 @@ func TestSubmodule(t *testing.T) {

ctx := context.Background()

tmp, err := ioutil.TempDir("", "submodule")
tmp, err := os.MkdirTemp("", "submodule")
require.NoError(t, err, "creating temporary directory")

defer func() {
Expand Down
5 changes: 2 additions & 3 deletions internal/testutils/repoutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand All @@ -29,7 +28,7 @@ type TestRepo struct {
func NewTestRepo(t *testing.T, bare bool, pattern string) *TestRepo {
t.Helper()

path, err := ioutil.TempDir("", pattern)
path, err := os.MkdirTemp("", pattern)
require.NoError(t, err)

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

path, err := ioutil.TempDir("", pattern)
path, err := os.MkdirTemp("", pattern)
require.NoError(t, err)

err = repo.GitCommand(
Expand Down