kube-plex/vendor/github.com/howeyc/gopass
2020-08-13 16:32:33 +08:00
..
.travis.yml Initial commit 2020-08-13 16:32:33 +08:00
LICENSE.txt Initial commit 2020-08-13 16:32:33 +08:00
OPENSOLARIS.LICENSE Initial commit 2020-08-13 16:32:33 +08:00
pass_test.go Initial commit 2020-08-13 16:32:33 +08:00
pass.go Initial commit 2020-08-13 16:32:33 +08:00
README.md Initial commit 2020-08-13 16:32:33 +08:00
terminal_solaris.go Initial commit 2020-08-13 16:32:33 +08:00
terminal.go Initial commit 2020-08-13 16:32:33 +08: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!