Revert "⬆️ Bump helm.sh/helm/v3 from 3.3.4 to 3.6.1 (#280)" (#281)

This reverts commit db8e3da01f.
This commit is contained in:
Ettore Di Giacinto
2022-01-08 09:36:01 +01:00
committed by GitHub
parent db8e3da01f
commit f8350a2f07
249 changed files with 6876 additions and 21190 deletions

View File

@@ -1,11 +1,11 @@
// +build windows
package windowsconsole
package windowsconsole // import "github.com/moby/term/windows"
import (
"os"
"golang.org/x/sys/windows"
"github.com/Azure/go-ansiterm/winterm"
)
// GetHandleInfo returns file descriptor and bool indicating whether the file is a console.
@@ -22,18 +22,14 @@ func GetHandleInfo(in interface{}) (uintptr, bool) {
if file, ok := in.(*os.File); ok {
inFd = file.Fd()
isTerminal = isConsole(inFd)
isTerminal = IsConsole(inFd)
}
return inFd, isTerminal
}
// IsConsole returns true if the given file descriptor is a Windows Console.
// The code assumes that GetConsoleMode will return an error for file descriptors that are not a console.
// Deprecated: use golang.org/x/sys/windows.GetConsoleMode() or golang.org/x/term.IsTerminal()
var IsConsole = isConsole
func isConsole(fd uintptr) bool {
var mode uint32
err := windows.GetConsoleMode(windows.Handle(fd), &mode)
return err == nil
func IsConsole(fd uintptr) bool {
_, e := winterm.GetConsoleMode(fd)
return e == nil
}