From a3e10757a52fa47a0608afd88986162ca5eb22cc Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 23 Feb 2024 15:01:41 +0200 Subject: lint warnings --- internal/ssh/ssh.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'internal/ssh/ssh.go') diff --git a/internal/ssh/ssh.go b/internal/ssh/ssh.go index db5aaf1..9c2dcb8 100644 --- a/internal/ssh/ssh.go +++ b/internal/ssh/ssh.go @@ -6,7 +6,6 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" "net" "os" "syscall" @@ -15,7 +14,7 @@ import ( gossh "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) // GeneratePrivateRSAKey is used by the server to generate its key. @@ -63,7 +62,7 @@ func Agent() (gossh.AuthMethod, error) { // EnterKeyPhrase is required to read phrase protected private keys. func EnterKeyPhrase(keyFile string) []byte { fmt.Printf("Enter phrase for key %s: ", keyFile) - phrase, err := terminal.ReadPassword(int(syscall.Stdin)) + phrase, err := term.ReadPassword(int(syscall.Stdin)) if err != nil { panic(err) } @@ -73,7 +72,7 @@ func EnterKeyPhrase(keyFile string) []byte { // KeyFile returns the key as a SSH auth method. func KeyFile(keyFile string) (gossh.AuthMethod, error) { - buffer, err := ioutil.ReadFile(keyFile) + buffer, err := os.ReadFile(keyFile) if err != nil { return nil, err } -- cgit v1.2.3