mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-04 00:44:27 +00:00
aaa3abf630
* wip * working for some ast nodes * works for all but assignment * works for all but mixed assignments * change test name * plug in the analyzer * remove `copy` from predeclared list * rename few shadowing names * rename `len` to `length` * add one more test case * rename `panic` to `panicResult` * replace `panic` with `panicResult` in error message * remove test case not covered by the tool * add `byte` to predeclared list * additional test cases * rename `copy` to `copyHandler` * exclude functions with receivers * revert to good names Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
23 lines
471 B
Go
23 lines
471 B
Go
package cmd
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/crypto/ssh/terminal"
|
|
)
|
|
|
|
// PasswordReader reads a password from a mock or stdin.
|
|
type PasswordReader interface {
|
|
ReadPassword() (string, error)
|
|
}
|
|
|
|
// StdInPasswordReader reads a password from stdin.
|
|
type StdInPasswordReader struct {
|
|
}
|
|
|
|
// ReadPassword reads a password from stdin.
|
|
func (pr StdInPasswordReader) ReadPassword() (string, error) {
|
|
pwd, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
|
return string(pwd), err
|
|
}
|