Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmtszr committed Jul 9, 2024
1 parent 282db08 commit ce6d3d5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,24 @@ func main() {

``` go
p := pipeline.Builder[*int]{}.
UseConditionalStepBuilder(
pipeline.NewConditionalStepBuilder[*int]().
Condition(func(context *int) bool {
return *context == 3
}).
IfTrue(Square{}).
IfFalse(Add{}),
).UsePipelineStep(Add{}).Build()
UseConditionalStepBuilder(
pipeline.NewConditionalStepBuilder[*int]().
Condition(func(context *int) bool {
return *context == 3
}).
IfTrue(Square{}).
IfFalse(Add{}),
).UsePipelineStep(Add{}).Build()

nm := 3
_ = p.Execute(&nm)
nm := 3
_ = p.Execute(&nm)

// nm 18
// nm 18

nm = 4
_ = p.Execute(&nm)
nm = 4
_ = p.Execute(&nm)

// nm 16
// nm 16
```
[doc-img]: https://godoc.org/github.com/mhmtszr/pipeline?status.svg
[doc]: https://godoc.org/github.com/mhmtszr/pipeline
Expand Down

0 comments on commit ce6d3d5

Please sign in to comment.