()
| 450 | } |
| 451 | |
| 452 | func (p *PTYCmd) Close() error { |
| 453 | p.t.Helper() |
| 454 | pErr := p.PTYCmd.Close() |
| 455 | if pErr != nil { |
| 456 | p.logf("PTYCmd: Close failed: %v", pErr) |
| 457 | } |
| 458 | eErr := p.outExpecter.close("PTYCmd close") |
| 459 | if eErr != nil { |
| 460 | p.logf("PTYCmd: close expecter failed: %v", eErr) |
| 461 | } |
| 462 | if pErr != nil { |
| 463 | return pErr |
| 464 | } |
| 465 | return eErr |
| 466 | } |
| 467 | |
| 468 | // stdbuf is like a buffered stdout, it buffers writes until read. |
| 469 | type stdbuf struct { |