monitorContainerExit is just a huge go routine
The function monitorContainerExit is just a huge anonymous function that gets called asynchronously:
https://github.com/docker-slim/docker-slim/blob/d6220ea5f2b91ee44e557a75a4123a246da2d13e/pkg/app/master/container/execution.go#L412
This is quite confusing from an API/usage perspective, as this function stays running in the background. I would suggest to refactor it a little bit, so that itself has to be called via go monitorContainerExit making the asynchronous nature more obvious.
yes, using a go routine to call monitorContainerExit or renaming it to startMonitorContainerExit will be good
finally :) https://github.com/slimtoolkit/slim/commit/502a2e34109d6e39647eaa4f8a4320cdb2186c09