Rename InputHidden to InputSecret

This commit is contained in:
2026-02-10 20:30:46 -05:00
parent 48e6abea8b
commit 29315c4b76
3 changed files with 15 additions and 8 deletions
+5 -3
View File
@@ -7,7 +7,8 @@ import (
"golang.org/x/term"
)
// InputMenuGen prompts the user with a menu and returns the user's choice as an integer.
// InputMenuGen prompts the user with a menu
// and returns the user's choice as an integer.
func InputMenuGen(prompt string, options []string) int {
for i, option := range options {
fmt.Printf("%d. %s\n", i+1, option)
@@ -15,8 +16,9 @@ func InputMenuGen(prompt string, options []string) int {
return InputInt("\n"+prompt, 1, len(options))
}
// InputHidden prompts the user for input and returns the input as a byte array, hiding the input from the terminal.
func InputHidden(prompt string) []byte {
// InputSecret prompts the user for input and returns the
// input as a byte array, hiding the input from the terminal.
func InputSecret(prompt string) []byte {
fmt.Print(prompt + " ")
byteInput, _ := term.ReadPassword(int(os.Stdin.Fd()))
fmt.Println()