tlog: switch from golang.org/x/crypto/ssh/terminal to golang.org/x/term

$ golangci-lint run

internal/tlog/log.go:13:2: SA1019: package golang.org/x/crypto/ssh/terminal is deprecated: this package moved to golang.org/x/term. (staticcheck)
	"golang.org/x/crypto/ssh/terminal"
This commit is contained in:
Jakob Unterwurzacher 2021-08-19 07:38:56 +02:00
parent 9c268fbe88
commit 2a25c3a8fd
2 changed files with 4 additions and 4 deletions

2
go.mod
View File

@ -16,5 +16,5 @@ require (
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
) )

View File

@ -10,7 +10,7 @@ import (
"log/syslog" "log/syslog"
"os" "os"
"golang.org/x/crypto/ssh/terminal" "golang.org/x/term"
) )
const ( const (
@ -106,7 +106,7 @@ var Warn *toggledLogger
var Fatal *toggledLogger var Fatal *toggledLogger
func init() { func init() {
if terminal.IsTerminal(int(os.Stdout.Fd())) { if term.IsTerminal(int(os.Stdout.Fd())) {
ColorReset = "\033[0m" ColorReset = "\033[0m"
ColorGrey = "\033[2m" ColorGrey = "\033[2m"
ColorRed = "\033[31m" ColorRed = "\033[31m"
@ -171,7 +171,7 @@ func PrintMasterkeyReminder(key []byte) {
// Quiet mode // Quiet mode
return return
} }
if !terminal.IsTerminal(int(os.Stdout.Fd())) { if !term.IsTerminal(int(os.Stdout.Fd())) {
// We don't want the master key to end up in a log file // We don't want the master key to end up in a log file
Info.Printf("Not running on a terminal, suppressing master key display\n") Info.Printf("Not running on a terminal, suppressing master key display\n")
return return