Skip to content

Commit

Permalink
proper logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jschauma committed May 29, 2022
1 parent 074a6e5 commit 00e5e19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ func main() {
// using the default prompt.
p, err = getpass.Getpass()
if err != nil {
log.Fatal("Unable to get password from user: %v\n", err)
log.Fatal("Unable to get password from user: ", err)
} else {
fmt.Printf("%s\n", p)
}
// Using a custom prompt:
p, err = getpass.Getpass("tty", "Please enter your secret passphrase: ")
if err != nil {
log.Fatal("Unable to get password from user: %v\n", err)
log.Fatal("Unable to get password from user: ", err)
} else {
fmt.Printf("%s\n", p)
}
Expand Down
4 changes: 2 additions & 2 deletions example/getpass_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ func main() {
// using the default prompt.
p, err = getpass.Getpass()
if err != nil {
log.Fatal("Unable to get password from user: %v\n", err)
log.Fatal("Unable to get password from user: ", err)
} else {
fmt.Printf("%s\n", p)
}

// Using a custom prompt:
p, err = getpass.Getpass("tty:Please enter your secret passphrase: ")
if err != nil {
log.Fatal("Unable to get password from user: %v\n", err)
log.Fatal("Unable to get password from user: ", err)
} else {
fmt.Printf("%s\n", p)
}
Expand Down

0 comments on commit 00e5e19

Please sign in to comment.