Skip to content

Expose App.osExit method as an option #1271

@oakad

Description

@oakad

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:

fx/app.go

Line 320 in f11bfed

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions