()
| 70 | } |
| 71 | |
| 72 | func (b *PtyBuffer) run() { |
| 73 | defer close(b.MessageCh) |
| 74 | buf := make([]byte, 4096) |
| 75 | for { |
| 76 | n, err := b.InputReader.Read(buf) |
| 77 | b.processData(buf[:n]) |
| 78 | if err == io.EOF { |
| 79 | b.setEOF() |
| 80 | return |
| 81 | } |
| 82 | if err != nil { |
| 83 | b.setErr(fmt.Errorf("error reading input: %w", err)) |
| 84 | return |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | func (b *PtyBuffer) processData(data []byte) { |
| 90 | outputBuf := make([]byte, 0, len(data)) |
no test coverage detected