mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
refactor: use t.TempDir() instead of os.MkdirTemp (#1832)
Signed-off-by: yuhangcangqian <cuibuwei@qq.com>
This commit is contained in:
@@ -28,7 +28,7 @@ func TestWrite(t *testing.T) {
|
||||
}
|
||||
|
||||
var tests []testTable
|
||||
tempDir := filepath.Join(os.TempDir(), "gct-temp")
|
||||
tempDir := t.TempDir()
|
||||
testFile := filepath.Join(tempDir, "gcttest.txt")
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
@@ -49,10 +49,6 @@ func TestWrite(t *testing.T) {
|
||||
t.Errorf("Test %d failed, unexpected err %s\n", x, err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := os.RemoveAll(tempDir); err != nil {
|
||||
t.Errorf("unable to remove temp test dir %s, manual deletion required", tempDir)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMove(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user