From 27b2ac7b5adf7c027c66e001991e7d94585d463c Mon Sep 17 00:00:00 2001 From: Arai Hiroki Date: Wed, 2 Aug 2023 22:43:17 +0900 Subject: [PATCH] feat: support task options for pipe.Tap --- pipe/tap.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipe/tap.go b/pipe/tap.go index 49a35fe..7eaec7c 100644 --- a/pipe/tap.go +++ b/pipe/tap.go @@ -21,7 +21,7 @@ func Tap[S any](fn TapFn[S]) *TapOp[S] { } // Convert the tap operator as a Pipe. -func (op *TapOp[S]) AsPipe() Pipe[S, S] { +func (op *TapOp[S]) AsPipe(opts ...task.Option) Pipe[S, S] { return Map(func(ctx context.Context, el S) (S, error) { var zero S err := op.run(ctx, el) @@ -29,7 +29,7 @@ func (op *TapOp[S]) AsPipe() Pipe[S, S] { return zero, err } return el, nil - }).AsPipe() + }).AsPipe(opts...) } // Convert the tap operator as a task.