use golang.org/x/term instead of depricated golang.org/x/crypto/ssh/terminal

This commit is contained in:
Samuel Lorch 2022-05-30 17:51:10 +02:00
parent df187e8a5f
commit a8b14c959f

View file

@ -14,18 +14,17 @@ import (
"github.com/passbolt/go-passbolt/api" "github.com/passbolt/go-passbolt/api"
"github.com/passbolt/go-passbolt/helper" "github.com/passbolt/go-passbolt/helper"
"github.com/spf13/viper" "github.com/spf13/viper"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term" "golang.org/x/term"
) )
func readPassword() (string, error) { func readPassword() (string, error) {
var fd int var fd int
var pass []byte var pass []byte
if terminal.IsTerminal(syscall.Stdin) { if term.IsTerminal(syscall.Stdin) {
fmt.Print("Enter Password:") fmt.Print("Enter Password:")
fd = syscall.Stdin fd = syscall.Stdin
inputPass, err := terminal.ReadPassword(fd) inputPass, err := term.ReadPassword(fd)
if err != nil { if err != nil {
return "", err return "", err
} }