Any tasks deferred in the main func will not execute if os.Exit is called. Moving application logic down into a new func which is called by main works around this limitation.
Any tasks deferred in the main func will not execute if os.Exit is called. Moving application logic down into a new func which is called by main works around this limitation.