зеркало из https://github.com/golang/term.git
term: add portability note re: std{in,out} fds
I recently made the mistake of assuming that stdin and stdout's fds were 0 and 1, respectively, leading to a bug report from a Windows user. With luck this note should prevent others from making the same mistake. Change-Id: I5391d91c431c3a801617f50d1b6a61121e2a939f Reviewed-on: https://go-review.googlesource.com/c/term/+/349149 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Carlos Amedee <carlos@golang.org>
This commit is contained in:
Родитель
6886f2dfbf
Коммит
140adaaadf
2
term.go
2
term.go
|
@ -12,6 +12,8 @@
|
|||
// panic(err)
|
||||
// }
|
||||
// defer term.Restore(int(os.Stdin.Fd()), oldState)
|
||||
//
|
||||
// Note that on non-Unix systems os.Stdin.Fd() may not be 0.
|
||||
package term
|
||||
|
||||
// State contains the state of a terminal.
|
||||
|
|
Загрузка…
Ссылка в новой задаче