fix windows build failing due to syscall

This commit is contained in:
Samuel Lorch 2022-05-30 19:49:02 +02:00
parent e5c267da42
commit fe7e6b2a22

View file

@ -9,7 +9,6 @@ import (
"net/http" "net/http"
"os" "os"
"strings" "strings"
"syscall"
"github.com/passbolt/go-passbolt/api" "github.com/passbolt/go-passbolt/api"
"github.com/passbolt/go-passbolt/helper" "github.com/passbolt/go-passbolt/helper"
@ -19,12 +18,11 @@ import (
// ReadPassword reads a Password interactively or via Pipe // ReadPassword reads a Password interactively or via Pipe
func ReadPassword() (string, error) { func ReadPassword() (string, error) {
var fd int fd := int(os.Stdin.Fd())
var pass []byte var pass []byte
if term.IsTerminal(syscall.Stdin) { if term.IsTerminal(fd) {
fmt.Print("Enter Password:") fmt.Print("Enter Password:")
fd = syscall.Stdin
inputPass, err := term.ReadPassword(fd) inputPass, err := term.ReadPassword(fd)
if err != nil { if err != nil {
return "", err return "", err