MCPcopy Index your code
hub / github.com/dnote/dnote / PromptPassword

Function PromptPassword

pkg/cli/ui/terminal.go:57–70  ·  view source on GitHub ↗

PromptPassword prompts the user input a password and saves the result to the destination. The input is masked, meaning it is not echoed on the terminal.

(message string, dest *string)

Source from the content-addressed store, hash-verified

55// PromptPassword prompts the user input a password and saves the result to the destination.
56// The input is masked, meaning it is not echoed on the terminal.
57func PromptPassword(message string, dest *string) error {
58 log.Askf(message, true)
59
60 password, err := terminal.ReadPassword(int(syscall.Stdin))
61 if err != nil {
62 return errors.Wrap(err, "getting user input")
63 }
64
65 fmt.Println("")
66
67 *dest = string(password)
68
69 return nil
70}
71
72// Confirm prompts for user input to confirm a choice
73func Confirm(question string, optimistic bool) (bool, error) {

Callers 1

getPasswordFunction · 0.92

Calls 1

AskfFunction · 0.92

Tested by

no test coverage detected