From addb25e7f4c59657107b4bee0bf4e3775d5e4d78 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Mon, 7 Jun 2021 20:25:02 +0200 Subject: [PATCH] Use go1.13 compatible way to read files --- cmd/create-account/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index d8e8ccf56..a1e254f8d 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -19,6 +19,7 @@ import ( "flag" "fmt" "io" + "io/ioutil" "os" "strings" "syscall" @@ -101,7 +102,7 @@ func getPassword(password, pwdFile *string, pwdStdin, askPass *bool, r io.Reader // read password from file if pwdFile != nil && *pwdFile != "" { - pw, err := os.ReadFile(*pwdFile) + pw, err := ioutil.ReadFile(*pwdFile) if err != nil { logrus.Fatalln("Unable to read password from file:", err) } @@ -110,7 +111,7 @@ func getPassword(password, pwdFile *string, pwdStdin, askPass *bool, r io.Reader // read password from stdin if pwdStdin != nil && *pwdStdin { - data, err := io.ReadAll(r) + data, err := ioutil.ReadAll(r) if err != nil { logrus.Fatalln("Unable to read password from stdin:", err) }