var shutdown … var cancel … // ShutdownContext returns a context object that will signal Cancel on Bot Shutdown func ShutdownContext() (context.Context, context.CancelFunc) { … } func SetShutdownContext(ctx context.Context) { … } func ShutDown() { … }