-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC for how to avoid duplicating WithStart and WithShutdown #12466
base: main
Are you sure you want to change the base?
POC for how to avoid duplicating WithStart and WithShutdown #12466
Conversation
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (74.19%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #12466 +/- ##
==========================================
- Coverage 92.10% 92.04% -0.06%
==========================================
Files 465 465
Lines 25180 25200 +20
==========================================
+ Hits 23191 23195 +4
- Misses 1592 1608 +16
Partials 397 397 ☔ View full report in Codecov by Sentry. |
StartFunc: bs.StartFunc, | ||
ShutdownFunc: bs.ShutdownFunc, | ||
Logs: logsConsumer, | ||
Component: component.NewComponent(bs.componentOptions...), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit: The abbreviated name of this "bs" variable isn't clear entirely clear here (metrics.go and traces.go also use it). The other files use names that are clearer from context.
This looks alright to me, I think we can apply it everywhere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this approach makes sense 👍🏻
This way, we allow in the future to add more options in the component that will automatically be picked by every component implementation, as well as we remove duplicate definition.