diff options
author | 2021-10-13 15:30:31 +0800 | |
---|---|---|
committer | 2021-10-13 09:30:31 +0200 | |
commit | 5191959bd7278b6ec990093ec708c262d7ef416e (patch) | |
tree | 0a48bb5bfd5f18673edee9ab7aa55497aa28eefb /test/erratic_autopath_test.go | |
parent | 44fcca0e0d67d66dee72ef00d389a16c2ff066a9 (diff) | |
download | coredns-5191959bd7278b6ec990093ec708c262d7ef416e.tar.gz coredns-5191959bd7278b6ec990093ec708c262d7ef416e.tar.zst coredns-5191959bd7278b6ec990093ec708c262d7ef416e.zip |
cleanup deprecated package io/ioutil (#4920)
Signed-off-by: zounengren <zouyee1989@gmail.com>
Diffstat (limited to 'test/erratic_autopath_test.go')
-rw-r--r-- | test/erratic_autopath_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/erratic_autopath_test.go b/test/erratic_autopath_test.go index ef7729815..1c6364a09 100644 --- a/test/erratic_autopath_test.go +++ b/test/erratic_autopath_test.go @@ -1,7 +1,6 @@ package test import ( - "io/ioutil" "os" "path/filepath" "testing" @@ -10,7 +9,7 @@ import ( ) func setupProxyTargetCoreDNS(t *testing.T, fn func(string)) { - tmpdir, err := ioutil.TempDir(os.TempDir(), "coredns") + tmpdir, err := os.MkdirTemp(os.TempDir(), "coredns") if err != nil { t.Fatal(err) } @@ -24,7 +23,7 @@ google.com. IN A 172.217.25.110 ` path := filepath.Join(tmpdir, "file") - if err = ioutil.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) |