From fc6d8737589e561432b669ba61f9748af39ccf1a Mon Sep 17 00:00:00 2001 From: Shireesh Anjal <355479+anjalshireesh@users.noreply.github.com> Date: Thu, 13 Jul 2023 21:37:10 +0530 Subject: [PATCH] Use os.ReadFile instead of ioutil.ReadFile (#17649) ioutil.ReadFile is deprecated and also doesn't work with certain kinds of symlinks. --- cmd/ftp-server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ftp-server.go b/cmd/ftp-server.go index 0ae1fddca..39387120f 100644 --- a/cmd/ftp-server.go +++ b/cmd/ftp-server.go @@ -23,11 +23,11 @@ import ( "fmt" "io" "net" + "os" "strconv" "strings" "github.com/minio/cli" - "github.com/minio/minio/internal/ioutil" "github.com/minio/minio/internal/logger" "github.com/pkg/sftp" ftp "goftp.io/server/v2" @@ -117,7 +117,7 @@ func startSFTPServer(c *cli.Context) { logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is mandatory for --sftp='ssh-private-key=path/to/id_ecdsa'"), "unable to start SFTP server") } - privateBytes, err := ioutil.ReadFile(sshPrivateKey) + privateBytes, err := os.ReadFile(sshPrivateKey) if err != nil { logger.Fatal(fmt.Errorf("invalid arguments passed, private key file is not accessible: %v", err), "unable to start SFTP server") }