mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
cleanup deprecated package io/ioutil (#4920)
Signed-off-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package auto
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -67,13 +66,13 @@ func TestWalkNonExistent(t *testing.T) {
|
||||
}
|
||||
|
||||
func createFiles() (string, error) {
|
||||
dir, err := ioutil.TempDir(os.TempDir(), "coredns")
|
||||
dir, err := os.MkdirTemp(os.TempDir(), "coredns")
|
||||
if err != nil {
|
||||
return dir, err
|
||||
}
|
||||
|
||||
for _, name := range dbFiles {
|
||||
if err := ioutil.WriteFile(filepath.Join(dir, name), []byte(zoneContent), 0644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(dir, name), []byte(zoneContent), 0644); err != nil {
|
||||
return dir, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user