chore: remove refs to deprecated io/ioutil

This commit is contained in:
guoguangwu
2024-02-02 17:22:04 +08:00
committed by ginuerzh
parent 7e1af1b557
commit fd57e80709
10 changed files with 21 additions and 27 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import (
"encoding/binary"
"errors"
"fmt"
"io/ioutil"
"os"
"net"
"strconv"
"strings"
@@ -33,7 +33,7 @@ var (
// ParseSSHKeyFile parses ssh key file.
func ParseSSHKeyFile(fp string) (ssh.Signer, error) {
key, err := ioutil.ReadFile(fp)
key, err := os.ReadFile(fp)
if err != nil {
return nil, err
}
@@ -42,7 +42,7 @@ func ParseSSHKeyFile(fp string) (ssh.Signer, error) {
// ParseSSHAuthorizedKeysFile parses ssh Authorized Keys file.
func ParseSSHAuthorizedKeysFile(fp string) (map[string]bool, error) {
authorizedKeysBytes, err := ioutil.ReadFile(fp)
authorizedKeysBytes, err := os.ReadFile(fp)
if err != nil {
return nil, err
}