Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Latest commit

 

History

History
27 lines (19 loc) · 716 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 716 Bytes

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!