From bdfb804bb206524a3f30768917d4ee5645276b0a Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 13 Aug 2020 17:59:10 +0200 Subject: [PATCH] Fix reading passwords on windows --- pkg/cmd/user.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/user.go b/pkg/cmd/user.go index ee1e4054001..db315295cfa 100644 --- a/pkg/cmd/user.go +++ b/pkg/cmd/user.go @@ -28,7 +28,6 @@ import ( "os" "strconv" "strings" - "syscall" "time" ) @@ -72,12 +71,12 @@ func getPasswordFromFlagOrInput() (pw string) { pw = userFlagPassword if userFlagPassword == "" { fmt.Print("Enter Password: ") - bytePW, err := terminal.ReadPassword(syscall.Stdin) + bytePW, err := terminal.ReadPassword(int(os.Stdin.Fd())) if err != nil { log.Fatalf("Error reading password: %s", err) } fmt.Printf("\nConfirm Password: ") - byteConfirmPW, err := terminal.ReadPassword(syscall.Stdin) + byteConfirmPW, err := terminal.ReadPassword(int(os.Stdin.Fd())) if err != nil { log.Fatalf("Error reading password: %s", err) }