Migrate to x/term

This commit is contained in:
Jannis Mattheis
2021-11-29 19:28:46 +01:00
parent 1466d8c357
commit b417ea4976
2 changed files with 3 additions and 3 deletions

View File

@@ -10,7 +10,7 @@ import (
"github.com/screego/server/logger"
"github.com/urfave/cli"
"golang.org/x/crypto/bcrypt"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)
var hashCmd = cli.Command{
@@ -30,7 +30,7 @@ var hashCmd = cli.Command{
if len(pass) == 0 {
var err error
_, _ = fmt.Fprint(os.Stderr, "Enter Password: ")
pass, err = terminal.ReadPassword(int(syscall.Stdin))
pass, err = term.ReadPassword(int(syscall.Stdin))
if err != nil {
log.Fatal().Err(err).Msg("could not read stdin")
}

2
go.mod
View File

@@ -19,6 +19,7 @@ require (
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
)
require (
@@ -41,7 +42,6 @@ require (
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)