fix windows build failure caused by #8431

No longer using the 'syscall' package, as further reading into this
issue has shown that 'syscall' is deprecated/locked down. Additional
issues posted on Golang's github indicates that the newer preferred
mechanism to get the file descriptor for stdin is: int(os.Stdin.Fd())

Signed-off-by: Jack Weldon <jack.weldon.scm@gmail.com>
pull/8432/head
Jack Weldon 5 years ago
parent 0f43a819c5
commit 7ba8343b8d
No known key found for this signature in database
GPG Key ID: 1B56CB7A4A85F02B

@ -24,7 +24,6 @@ import (
"os"
"path/filepath"
"strings"
"syscall"
"time"
"github.com/gofrs/flock"
@ -117,8 +116,9 @@ func (o *repoAddOptions) run(out io.Writer) error {
}
if o.username != "" && o.password == "" {
fd := int(os.Stdin.Fd())
fmt.Fprint(out, "Password: ")
password, err := terminal.ReadPassword(syscall.Stdin)
password, err := terminal.ReadPassword(fd)
fmt.Fprintln(out)
if err != nil {
return err

Loading…
Cancel
Save