replace deprecated method

This commit is contained in:
Charles Xu
2023-09-18 10:16:48 +00:00
parent 03721e8c7e
commit 7833ca8bc6
11 changed files with 19 additions and 22 deletions

View File

@ -4,7 +4,7 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"github.com/go-gost/core/auth"
"golang.org/x/crypto/ssh"
@ -58,7 +58,7 @@ func PublicKeyCallback(keys map[string]bool) PublicKeyCallbackFunc {
// ParseSSHAuthorizedKeysFile parses ssh authorized keys file.
func ParseAuthorizedKeysFile(name string) (map[string]bool, error) {
authorizedKeysBytes, err := ioutil.ReadFile(name)
authorizedKeysBytes, err := os.ReadFile(name)
if err != nil {
return nil, err
}