| 1 |
Forwarded: https://github.com/go-godo/godo/pull/64 |
| 2 |
From: Simon Josefsson <[email protected]> |
| 3 |
Date: Sat, 28 Mar 2026 09:42:57 +0100 |
| 4 |
Subject: [PATCH] Avoid howeyc/gopass |
| 5 |
|
| 6 |
diff --git a/exec.go b/exec.go |
| 7 |
index e79be30..06554be 100644 |
| 8 |
--- a/exec.go |
| 9 |
+++ b/exec.go |
| 10 |
@@ -8,7 +8,7 @@ import ( |
| 11 |
"strconv" |
| 12 |
"strings" |
| 13 |
|
| 14 |
|
| 15 |
+ "golang.org/x/term" |
| 16 |
"github.com/mgutz/str" |
| 17 |
"github.com/nozzle/throttler" |
| 18 |
"gopkg.in/godo.v2/util" |
| 19 |
@@ -297,7 +297,7 @@ func Prompt(prompt string) string { |
| 20 |
// PromptPassword prompts user for password input. |
| 21 |
func PromptPassword(prompt string) string { |
| 22 |
fmt.Printf(prompt) |
| 23 |
|
| 24 |
+ b, err := term.ReadPassword(int(os.Stdin.Fd())) |
| 25 |
if err != nil { |
| 26 |
fmt.Println(err.Error()) |
| 27 |
return "" |
| 28 |
diff --git a/util/prompt.go b/util/prompt.go |
| 29 |
index f7b030c..7589887 100644 |
| 30 |
--- a/util/prompt.go |
| 31 |
+++ b/util/prompt.go |
| 32 |
@@ -5,7 +5,7 @@ import ( |
| 33 |
"fmt" |
| 34 |
"os" |
| 35 |
|
| 36 |
|
| 37 |
+ "golang.org/x/term" |
| 38 |
) |
| 39 |
|
| 40 |
// Prompt prompts user for input with default value. |
| 41 |
@@ -19,7 +19,7 @@ func Prompt(prompt string) string { |
| 42 |
// PromptPassword prompts user for password input. |
| 43 |
func PromptPassword(prompt string) string { |
| 44 |
fmt.Printf(prompt) |
| 45 |
|
| 46 |
+ b, err := term.ReadPassword(int(os.Stdin.Fd())) |
| 47 |
if err != nil { |
| 48 |
fmt.Println(err.Error()) |
| 49 |
return "" |