fx icon indicating copy to clipboard operation
fx copied to clipboard

Expose App.osExit method as an option

Open oakad opened this issue 7 months ago • 0 comments

It so happens, that App already has a handy method called osExec which can be used to override the exit action (when such is signaled from Shutdowner, for example:

https://github.com/uber-go/fx/blob/f11bfed22eb3420720babc6be5901d8fda6f7c4a/app.go#L320

The comment helpfully mentions that it is "used for testing only".

In actuality, there exist other scenarios where it can be desirable to override the osExit method. In particular, this comes very handy when doing various "soft" containers for fx controlled apps; sometimes even it's several fx apps within an fx app, matroška style.

oakad avatar May 13 '25 11:05 oakad