Skip to content

Commit

Permalink
Update terminal.go for windows os
Browse files Browse the repository at this point in the history
term.ReadPassword() requires an int. On windows passing syscall.Stdin without type casting fails.
  • Loading branch information
shivakumargn authored Apr 2, 2024
1 parent eb172d9 commit b777b73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b777b73

Please sign in to comment.