github.com/driusan/dgit@v0.0.0-20221118233547-f39f0c15edbb/git/password_other.go (about) 1 //go:build !plan9 2 // +build !plan9 3 4 package git 5 6 import ( 7 "fmt" 8 "os" 9 10 "golang.org/x/crypto/ssh/terminal" 11 ) 12 13 func getUserPassword(url string) (userPasswd, error) { 14 user := readLine("Username: ") 15 16 fmt.Fprintf(os.Stderr, "Password: ") 17 pwb, err := terminal.ReadPassword(0) 18 return userPasswd{user, string(pwb)}, err 19 }