From b777b73c28db07da3c439683bd767613cd1f65bd Mon Sep 17 00:00:00 2001 From: sgn Date: Tue, 2 Apr 2024 12:12:25 +0530 Subject: [PATCH] Update terminal.go for windows os term.ReadPassword() requires an int. On windows passing syscall.Stdin without type casting fails. --- examples/terminal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/terminal.go b/examples/terminal.go index d26925625b..922b21776a 100644 --- a/examples/terminal.go +++ b/examples/terminal.go @@ -55,7 +55,7 @@ func (a Terminal) Phone(_ context.Context) (string, error) { func (Terminal) Password(_ context.Context) (string, error) { fmt.Print("Enter 2FA password: ") - bytePwd, err := term.ReadPassword(syscall.Stdin) + bytePwd, err := term.ReadPassword(int(syscall.Stdin)) if err != nil { return "", err }