mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
No need to manually remove tmp directory created by t.TempDir()
The temporary directory created by t.TempDir() can be automatically removed by the golang testing utilities. So no need to remove it manually. FYI. https://github.com/golang/go/blob/go1.16.15/src/testing/testing.go#L911-L915 https://github.com/golang/go/blob/go1.16.15/src/testing/testing.go#L957 Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
parent
b75aa3eb4c
commit
f6cfd465cc
@ -180,7 +180,6 @@ func TestDirPermission(t *testing.T) {
|
||||
|
||||
func TestRemoveMatchFile(t *testing.T) {
|
||||
tmpdir := t.TempDir()
|
||||
defer os.RemoveAll(tmpdir)
|
||||
f, err := os.CreateTemp(tmpdir, "tmp")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user