INNER CODE UNIT · Go
EOF
Netflix/go-expect · expect_opt.go:300
func EOF(opts *ExpectOpts) error {
return Error(io.EOF)(opts)
}
// PTSClosed adds an Expect condition to exit if we get an
// "read /dev/ptmx: input/output error" error which can occur
// on Linux while reading from the ptm after the pts is closed.
// Further Reading:
// https://github.com/kr/pty/issues/21#issuecomment-129381749
func PTSClosed(opts *ExpectOpts) error {
opts.Matchers = append(opts.Matchers, &pathErrorMatcher{
pathError: os.PathError{
Op: "read",
Path: "/dev/ptmx",
Err: syscall.Errno(0x5),
},
})
return nil