opentofu/vendor/github.com/howeyc/gopass
2017-02-24 19:57:51 +00:00
..
LICENSE.txt vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230) 2017-02-24 19:57:51 +00:00
OPENSOLARIS.LICENSE vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230) 2017-02-24 19:57:51 +00:00
pass.go vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230) 2017-02-24 19:57:51 +00:00
README.md vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230) 2017-02-24 19:57:51 +00:00
terminal_solaris.go vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230) 2017-02-24 19:57:51 +00:00
terminal.go vendor: k8s.io/kubernetes/pkg/...@v1.5.3 (#12230) 2017-02-24 19:57:51 +00:00

getpasswd in Go GoDoc Build Status

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!