Skip to content

Commit 3d273c2

Browse files
znullCopilot
andauthored
use correct code example in README
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 9dacf4b commit 3d273c2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It's normal for pipelines to stop before all input has been consumed[^1]. If an
1010

1111
In go-pipe v1 it was possible to get away without handling this case, because a command stage's stdin was connected in a way that often (but not necessarily!) drained the write side and hid the error from the previous stage feeding it. That was an implementation detail, not a guarantee. In go-pipe v2, producer stages are more likely to be connected directly to a command's stdin, and thus see the error themselves.
1212

13-
Fortunately, this is easily handled by wrapping the stage with `pipe.IgnoreError(stage, IsPipeError)`. If the producer only writes output and is otherwise stateless, that's the only thing needed.
13+
Fortunately, this is easily handled by wrapping the stage with `pipe.IgnoreError(stage, pipe.IsPipeError)`. If the producer only writes output and is otherwise stateless, that's the only thing needed.
1414

1515
If the producer also updates state, metrics, cursors, or has other side effects, in a way that depends on how much of the output was produced, then in addition to using `pipe.IgnoreError`, you must also ensure producer-owned state is brought to a consistent point before returning the error.
1616

0 commit comments

Comments
 (0)