mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
99a8d0bac6
* Improve `NewServiceRegistry` documentation. * Improve `README.md`. * Improve readability of `registerValidatorService`. * Move `log` in `main.go`. Since `log` is only used in `main.go`. * Clean Tos. * `DefaultDataDir`: Use `switch` instead of `if/elif`. * `ReadPassword`: Remove unused receiver. * `validator/main.go`: Clean. * `WarnIfPlatformNotSupported`: Add Mac OSX ARM64. * `runner.go`: Use idiomatic `err` handling. * `waitForChainStart`: Avoid `chainStartResponse`mutation. * `WaitForChainStart`: Reduce cognitive complexity. * Logs: `powchain` ==> `execution`.
23 lines
468 B
Go
23 lines
468 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 (StdInPasswordReader) ReadPassword() (string, error) {
|
|
pwd, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
|
return string(pwd), err
|
|
}
|