Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Allow hiding password length
Browse files Browse the repository at this point in the history
  • Loading branch information
szh committed Apr 3, 2023
1 parent fa37277 commit dbbfd15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions terminal/runereader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func (rr *RuneReader) printChar(char rune, mask rune) error {
_, err := fmt.Fprintf(rr.stdio.Out, "%c", char)
return err
}
// if the mask is a space, don't print anything
if mask == ' ' {
return nil
}
// otherwise print the mask we were given
_, err := fmt.Fprintf(rr.stdio.Out, "%c", mask)
return err
Expand Down

0 comments on commit dbbfd15

Please sign in to comment.