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:
|
osExit func(code int) // os.Exit override; used for testing only |
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.
It so happens, that
Appalready has a handy method calledosExecwhich can be used to override the exit action (when such is signaled fromShutdowner, for example:fx/app.go
Line 320 in f11bfed
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
osExitmethod. 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.