mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 01:03:10 -06:00
Use go1.13 compatible way to read files
This commit is contained in:
parent
70c43bcb2e
commit
addb25e7f4
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
@ -101,7 +102,7 @@ func getPassword(password, pwdFile *string, pwdStdin, askPass *bool, r io.Reader
|
||||||
|
|
||||||
// read password from file
|
// read password from file
|
||||||
if pwdFile != nil && *pwdFile != "" {
|
if pwdFile != nil && *pwdFile != "" {
|
||||||
pw, err := os.ReadFile(*pwdFile)
|
pw, err := ioutil.ReadFile(*pwdFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatalln("Unable to read password from file:", err)
|
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
|
// read password from stdin
|
||||||
if pwdStdin != nil && *pwdStdin {
|
if pwdStdin != nil && *pwdStdin {
|
||||||
data, err := io.ReadAll(r)
|
data, err := ioutil.ReadAll(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatalln("Unable to read password from stdin:", err)
|
logrus.Fatalln("Unable to read password from stdin:", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue