Commit 6e7976a
Unwrap nopWriteCloser to expose ReaderFrom
When the pipeline's stdout is set via WithStdout, the writer is
wrapped in nopWriteCloser to add a no-op Close method. This
wrapper hides the ReaderFrom interface of the underlying writer,
preventing io.CopyBuffer from dispatching to it.
Fix: unwrap nopWriteCloser in ioCopier and call ReadFrom directly
when available. This enables zero-copy when the destination has a
meaningful ReadFrom (e.g., network connections, custom writers).
For the pipe-to-pipe *os.File case, File.ReadFrom's zero-copy
paths don't yet support pipe sources, so a follow-up commit adds
direct splice(2) for that case.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent afe1947 commit 6e7976a
1 file changed
Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
| |||
0 commit comments