Write prompt to stderr instead of stdout

This commit is contained in:
Alexander Neumann 2015-01-02 22:33:16 +01:00
parent 1789e6151d
commit 2e28b88e3a
1 changed files with 2 additions and 2 deletions

View File

@ -40,12 +40,12 @@ func readPassword(env string, prompt string) string {
}
}
fmt.Print(prompt)
fmt.Fprint(os.Stderr, prompt)
pw, err := terminal.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
errx(2, "unable to read password: %v", err)
}
fmt.Println()
fmt.Fprintln(os.Stderr)
return string(pw)
}