aboutsummaryrefslogtreecommitdiff
path: root/test/erratic_autopath_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/erratic_autopath_test.go')
-rw-r--r--test/erratic_autopath_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/erratic_autopath_test.go b/test/erratic_autopath_test.go
index 1c6364a09..0e7b20eb0 100644
--- a/test/erratic_autopath_test.go
+++ b/test/erratic_autopath_test.go
@@ -9,11 +9,7 @@ import (
)
func setupProxyTargetCoreDNS(t *testing.T, fn func(string)) {
- tmpdir, err := os.MkdirTemp(os.TempDir(), "coredns")
- if err != nil {
- t.Fatal(err)
- }
- defer os.RemoveAll(tmpdir)
+ tmpdir := t.TempDir()
content := `
example.org. IN SOA sns.dns.icann.org. noc.dns.icann.org. 1 3600 3600 3600 3600
@@ -23,7 +19,7 @@ google.com. IN A 172.217.25.110
`
path := filepath.Join(tmpdir, "file")
- if err = os.WriteFile(path, []byte(content), 0644); err != nil {
+ if err := os.WriteFile(path, []byte(content), 0644); err != nil {
t.Fatalf("Could not write to temp file: %s", err)
}
defer os.Remove(path)