Skip to content

Commit 11cdce9

Browse files
committed
Use ioutil.TempDir.
1 parent d3da796 commit 11cdce9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/testutil.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"github.com/stretchr/testify/assert"
66
"github.com/stretchr/testify/require"
77
lua "github.com/yuin/gopher-lua"
8+
"io/ioutil"
89
"os"
910
"strings"
1011
"testing"
@@ -99,7 +100,8 @@ func tTempDir(L *lua.LState) int {
99100
t := checkT(L, 1)
100101
// TODO(scr): When the minimal version supported has this on the *testing.T object, remove this shim
101102
//L.Push(lua.LString(t.TempDir()))
102-
tempDir := os.TempDir()
103+
tempDir, err := ioutil.TempDir(os.TempDir(), "test.tempDir*")
104+
require.NoError(t, err)
103105
t.Cleanup(func() {
104106
_ = os.RemoveAll(tempDir)
105107
})

0 commit comments

Comments
 (0)