mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-30 10:10:21 +00:00
.. | ||
.travis.yml | ||
LICENSE.txt | ||
OPENSOLARIS.LICENSE | ||
pass_test.go | ||
pass.go | ||
README.md | ||
terminal_solaris.go | ||
terminal.go |
getpasswd in Go
Retrieve password from user terminal or piped input without echo.
Verified on BSD, Linux, and Windows.
Example:
package main
import "fmt"
import "github.com/howeyc/gopass"
func main() {
fmt.Printf("Password: ")
// Silent. For printing *'s use gopass.GetPasswdMasked()
pass, err := gopass.GetPasswd()
if err != nil {
// Handle gopass.ErrInterrupted or getch() read error
}
// Do something with pass
}
Caution: Multi-byte characters not supported!