diff options
author | 2023-06-17 21:21:01 +0800 | |
---|---|---|
committer | 2023-06-17 15:21:01 +0200 | |
commit | b868350fc2823f429cc828558f3425d5135e680f (patch) | |
tree | ab6af66c78d1d0ca1c5bf289d6664317af3a397b /plugin/grpc | |
parent | 06cd8439182be8b9ed17280eaae411f9afb7c8f2 (diff) | |
download | coredns-b868350fc2823f429cc828558f3425d5135e680f.tar.gz coredns-b868350fc2823f429cc828558f3425d5135e680f.tar.zst coredns-b868350fc2823f429cc828558f3425d5135e680f.zip |
test: use `t.TempDir` to create temporary test directory (#6164)
Diffstat (limited to 'plugin/grpc')
-rw-r--r-- | plugin/grpc/proxy_test.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/plugin/grpc/proxy_test.go b/plugin/grpc/proxy_test.go index 534fde3d7..2ca0b1b48 100644 --- a/plugin/grpc/proxy_test.go +++ b/plugin/grpc/proxy_test.go @@ -4,7 +4,6 @@ import ( "context" "errors" "net" - "os" "path" "testing" @@ -72,11 +71,7 @@ func (m testServiceClient) Query(ctx context.Context, in *pb.DnsPacket, opts ... } func TestProxyUnix(t *testing.T) { - tdir, err := os.MkdirTemp("", "tmp*") - if err != nil { - t.Fatal(err) - } - defer os.RemoveAll(tdir) + tdir := t.TempDir() fd := path.Join(tdir, "test.grpc") listener, err := net.Listen("unix", fd) |