diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-11-25 16:53:51 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-11-25 16:53:51 -0800 |
commit | 39b03cc393da657b11dbf25e51e2495f8739e491 (patch) | |
tree | 0231ec313a78453a8fccbac73919f25cd9cf598a /vendor/golang.org/x/crypto/ssh/terminal/util_windows.go | |
parent | f072439b79ff6a003810a337664961865fefa755 (diff) |
Add integration tests for feed creation
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/terminal/util_windows.go')
-rw-r--r-- | vendor/golang.org/x/crypto/ssh/terminal/util_windows.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go index 60979cc..92944f3 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go @@ -17,6 +17,8 @@ package terminal import ( + "os" + "golang.org/x/sys/windows" ) @@ -71,13 +73,6 @@ func GetSize(fd int) (width, height int, err error) { return int(info.Size.X), int(info.Size.Y), nil } -// passwordReader is an io.Reader that reads from a specific Windows HANDLE. -type passwordReader int - -func (r passwordReader) Read(buf []byte) (int, error) { - return windows.Read(windows.Handle(r), buf) -} - // ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. @@ -98,5 +93,5 @@ func ReadPassword(fd int) ([]byte, error) { windows.SetConsoleMode(windows.Handle(fd), old) }() - return readPasswordLine(passwordReader(fd)) + return readPasswordLine(os.NewFile(uintptr(fd), "stdin")) } |