about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-02-11T15·33+0100
committerVincent Ambo <tazjin@gmail.com>2017-02-11T15·33+0100
commite4ee5a452622de946e4b9a62aeedb6eb3a6851dd (patch)
tree012e3f5092ef6a00f4cd5d3e7f5d77bae78aea85
parent4a85116b4a04765e13a0aa7c8b8a37778ef8dcbd (diff)
fix: Portability of stdin
-rw-r--r--main.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.go b/main.go
index 9ac5598b1724..ec0f55f429ee 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