mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-24 19:24:35 +00:00
*: fix build errors on windows
This commit is contained in:
parent
67eac3a27f
commit
fbc09a415e
1 changed files with 4 additions and 4 deletions
|
@ -25,11 +25,11 @@ type ReadWriter struct {
|
||||||
func ReadLine(prompt string) (string, error) {
|
func ReadLine(prompt string) (string, error) {
|
||||||
trm := Terminal
|
trm := Terminal
|
||||||
if trm == nil {
|
if trm == nil {
|
||||||
s, err := term.MakeRaw(syscall.Stdin)
|
s, err := term.MakeRaw(int(syscall.Stdin))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
defer func() { _ = term.Restore(syscall.Stdin, s) }()
|
defer func() { _ = term.Restore(int(syscall.Stdin), s) }()
|
||||||
trm = term.NewTerminal(ReadWriter{
|
trm = term.NewTerminal(ReadWriter{
|
||||||
Reader: os.Stdin,
|
Reader: os.Stdin,
|
||||||
Writer: os.Stdout,
|
Writer: os.Stdout,
|
||||||
|
@ -50,11 +50,11 @@ func readLine(trm *term.Terminal, prompt string) (string, error) {
|
||||||
func ReadPassword(prompt string) (string, error) {
|
func ReadPassword(prompt string) (string, error) {
|
||||||
trm := Terminal
|
trm := Terminal
|
||||||
if trm == nil {
|
if trm == nil {
|
||||||
s, err := term.MakeRaw(syscall.Stdin)
|
s, err := term.MakeRaw(int(syscall.Stdin))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
defer func() { _ = term.Restore(syscall.Stdin, s) }()
|
defer func() { _ = term.Restore(int(syscall.Stdin), s) }()
|
||||||
trm = term.NewTerminal(ReadWriter{os.Stdin, os.Stdout}, prompt)
|
trm = term.NewTerminal(ReadWriter{os.Stdin, os.Stdout}, prompt)
|
||||||
}
|
}
|
||||||
return trm.ReadPassword(prompt)
|
return trm.ReadPassword(prompt)
|
||||||
|
|
Loading…
Reference in a new issue