mirror of
https://github.com/coredns/coredns.git
synced 2026-01-16 22:01:20 -05:00
cleanup deprecated package io/ioutil (#4920)
Signed-off-by: zounengren <zouyee1989@gmail.com>
This commit is contained in:
@@ -3,7 +3,6 @@ package sign
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -15,7 +14,7 @@ import (
|
||||
|
||||
// write writes out the zone file to a temporary file which is then moved into the correct place.
|
||||
func (s *Signer) write(z *file.Zone) error {
|
||||
f, err := ioutil.TempFile(s.directory, "signed-")
|
||||
f, err := os.CreateTemp(s.directory, "signed-")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/rsa"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
@@ -70,7 +70,7 @@ func readKeyPair(public, private string) (Pair, error) {
|
||||
if err != nil {
|
||||
return Pair{}, err
|
||||
}
|
||||
b, err := ioutil.ReadAll(rk)
|
||||
b, err := io.ReadAll(rk)
|
||||
if err != nil {
|
||||
return Pair{}, err
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package sign
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -50,7 +49,7 @@ $ORIGIN example.org.
|
||||
@ IN SOA linode miek.miek.nl. ( 1282630060 4H 1H 7D 4H )
|
||||
IN NS linode
|
||||
`
|
||||
if err := ioutil.WriteFile("db.apex-test.example.org", []byte(apex), 0644); err != nil {
|
||||
if err := os.WriteFile("db.apex-test.example.org", []byte(apex), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.Remove("db.apex-test.example.org")
|
||||
|
||||
Reference in New Issue
Block a user