From 332304a7b1ffc5d5dac0cd9e971b0a4c33b68c7a Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Fri, 1 Apr 2022 16:15:06 -0500 Subject: [PATCH] fix: use `golang.org/x/term` instead of `golang.org/x/crypto/ssh/terminal` The latter is deprecated: https://pkg.go.dev/golang.org/x/crypto/ssh/terminal --- cli/ssh.go | 7 +++---- go.mod | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/ssh.go b/cli/ssh.go index 6cae395d28c1e..e8310c53a2302 100644 --- a/cli/ssh.go +++ b/cli/ssh.go @@ -11,10 +11,9 @@ import ( "github.com/pion/webrtc/v3" "github.com/spf13/cobra" gossh "golang.org/x/crypto/ssh" + "golang.org/x/term" "golang.org/x/xerrors" - "golang.org/x/crypto/ssh/terminal" - "github.com/coder/coder/cli/cliflag" "github.com/coder/coder/cli/cliui" "github.com/coder/coder/coderd/database" @@ -131,12 +130,12 @@ func ssh() *cobra.Command { } if isatty.IsTerminal(os.Stdout.Fd()) { - state, err := terminal.MakeRaw(int(os.Stdin.Fd())) + state, err := term.MakeRaw(int(os.Stdin.Fd())) if err != nil { return err } defer func() { - _ = terminal.Restore(int(os.Stdin.Fd()), state) + _ = term.Restore(int(os.Stdin.Fd()), state) }() } diff --git a/go.mod b/go.mod index 2a96acb125815..231f3612cac52 100644 --- a/go.mod +++ b/go.mod @@ -236,7 +236,7 @@ require ( go.opencensus.io v0.23.0 // indirect golang.org/x/mod v0.5.1 // indirect golang.org/x/net v0.0.0-20220325170049-de3da57026de // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect golang.org/x/tools v0.1.9 // indirect