mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-04 00:24:59 +00:00
Fixup golang.org/x/term staticcheck warnings
Errors from staticcheck: cmd/preferredimports/preferredimports.go:38:2: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (SA1019) vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go:36:2: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (SA1019) vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go:26:2: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (SA1019) Please review the above warnings. You can test via: hack/verify-staticcheck.sh <failing package> If the above warnings do not make sense, you can exempt the line or file. See: https://staticcheck.io/docs/#ignoring-problems generated: - hack/update-internal-modules.sh - hack/lint-dependencies.sh - hack/update-vendor.sh Signed-off-by: Stephen Augustus <foo@auggie.dev> Kubernetes-commit: d9435800b65d6787beaf061546599d757b8e87c9
This commit is contained in:
committed by
Kubernetes Publisher
parent
768a62f124
commit
b13f594878
@@ -23,7 +23,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"golang.org/x/term"
|
||||
|
||||
clientauth "k8s.io/client-go/tools/auth"
|
||||
)
|
||||
@@ -90,8 +90,8 @@ func promptForString(field string, r io.Reader, show bool) (result string, err e
|
||||
_, err = fmt.Fscan(r, &result)
|
||||
} else {
|
||||
var data []byte
|
||||
if terminal.IsTerminal(int(os.Stdin.Fd())) {
|
||||
data, err = terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
if term.IsTerminal(int(os.Stdin.Fd())) {
|
||||
data, err = term.ReadPassword(int(os.Stdin.Fd()))
|
||||
result = string(data)
|
||||
} else {
|
||||
return "", fmt.Errorf("error reading input for %s", field)
|
||||
|
Reference in New Issue
Block a user