go.mod: Migrate to golang.org/x/term (#4073)

golang.org/x/crypto/ssh/terminal is deprecated in favor of golang.org/x/term

See https://github.com/caddyserver/caddy/pull/4073/checks?check_run_id=2152150495
Error: SA1019: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term.  (staticcheck)

See https://github.com/caddyserver/caddy/pull/4073/checks?check_run_id=2152228516
Error: SA1019: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term.  (staticcheck)

Test: go test -count=1 './...'
This commit is contained in:
Simão Gomes Viana
2021-03-29 20:39:08 +02:00
committed by GitHub
parent d63d5ae1ce
commit 1c8ea00828
4 changed files with 12 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"golang.org/x/crypto/ssh/terminal"
"golang.org/x/term"
)
func init() {
@@ -670,7 +670,7 @@ func newDefaultProductionLog() (*defaultCustomLog, error) {
func newDefaultProductionLogEncoder(colorize bool) zapcore.Encoder {
encCfg := zap.NewProductionEncoderConfig()
if terminal.IsTerminal(int(os.Stdout.Fd())) {
if term.IsTerminal(int(os.Stdout.Fd())) {
// if interactive terminal, make output more human-readable by default
encCfg.EncodeTime = func(ts time.Time, encoder zapcore.PrimitiveArrayEncoder) {
encoder.AppendString(ts.UTC().Format("2006/01/02 15:04:05.000"))