Skip to content

How to end session in middleware when using MiddlewareWithProgramHandler() #163

Answered by caarlos0
eltsu7 asked this question in Q&A
Discussion options

You must be logged in to vote

if you want the session to exit 0, probably the easiest way would be to create a userAlreadyPlayingModel and return a program that runs that instead.

that model would in turn defer tea.Quit and/or print a message to the user while doing so.

on the other hand, if it's ok for the user to see an error exit code on their side, you can quit with wish.Fatal.*

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eltsu7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants