From 0a0e1bbb2f2127fdaeed5c8039dfcb55f7e8d20d Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Sat, 6 May 2023 20:19:45 +0800 Subject: [PATCH] Replace deprecated "golang.org/x/crypto/ssh/terminal" with "golang.org/x/term" (#1464) --- go.mod | 4 ++-- go.sum | 8 ++++---- utils/logging/format.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index bf8f0a79d44..f4b7580aca1 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5 golang.org/x/sync v0.1.0 - golang.org/x/term v0.5.0 + golang.org/x/term v0.7.0 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac gonum.org/v1/gonum v0.11.0 google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c @@ -125,7 +125,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect + golang.org/x/sys v0.7.0 // indirect golang.org/x/text v0.7.0 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/urfave/cli.v1 v1.20.0 // indirect diff --git a/go.sum b/go.sum index d83cee59ef2..9fbe36524cc 100644 --- a/go.sum +++ b/go.sum @@ -685,12 +685,12 @@ golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/utils/logging/format.go b/utils/logging/format.go index 1e979f742ab..5ea9de28f08 100644 --- a/utils/logging/format.go +++ b/utils/logging/format.go @@ -9,7 +9,7 @@ import ( "strings" "go.uber.org/zap/zapcore" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) // Format modes available @@ -59,7 +59,7 @@ func ToFormat(h string, fd uintptr) (Format, error) { case "JSON": return JSON, nil case "AUTO": - if !terminal.IsTerminal(int(fd)) { + if !term.IsTerminal(int(fd)) { return Plain, nil } return Colors, nil