uber-go / fx

A dependency injection based application framework for Go.
https://uber-go.github.io/fx/
MIT License
5.72k stars 289 forks source link

fix: Only register signal handlers if user intends to use them #1215

Closed MarcoPolo closed 3 months ago

MarcoPolo commented 3 months ago

closes #1212, and fixes a regression from #989. Previously we would only register signal handlers if the user intended to use them. #989 changed this behavior here.

This regression meant that if you only used app.Start()/app.Stop(), fx would register signal handlers for no reason as the user didn't use app.Done/app.Wait.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.41%. Comparing base (d0d12e9) to head (34bdbf2).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1215 +/- ## ======================================= Coverage 98.41% 98.41% ======================================= Files 34 34 Lines 2908 2909 +1 ======================================= + Hits 2862 2863 +1 Misses 38 38 Partials 8 8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JacobOaks commented 3 months ago

Thanks for updating the PR @MarcoPolo! Mostly LGTM, just a couple small comments.

ccoVeille commented 3 months ago

@MarcoPolo or @JacobOaks tell me if the review I made, makes no sense :sweat_smile: