I don't think maintaining an implementation of both 'do' and 'undo' sounds fun. Maybe I could write into some temporary state and only "commit" once when I know all operations passed? If that's possible depends on the specifics...
Also, defer is a great alternative to gotos:)
— Jakub Tomšů (@jakubtomsu_)