From e4ee5a452622de946e4b9a62aeedb6eb3a6851dd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 11 Feb 2017 16:33:16 +0100 Subject: fix: Portability of stdin --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 9ac5598b17..ec0f55f429 100644 --- a/main.go +++ b/main.go @@ -4,10 +4,11 @@ import ( "bufio" "encoding/xml" "fmt" + "golang.org/x/crypto/ssh/terminal" "net/http" "os" "strings" - "golang.org/x/crypto/ssh/terminal" + "syscall" ) // The XML response returned by the WatchGuard server @@ -60,7 +61,7 @@ func readCredentials() (string, string, error) { username, err := reader.ReadString('\n') fmt.Printf("Password: ") - password, err := terminal.ReadPassword(1) + password, err := terminal.ReadPassword(syscall.Stdin) // If an error occured, I don't care about which one it is. return strings.TrimSpace(username), strings.TrimSpace(string(password)), err -- cgit 1.4.1