angadn / DONOTUSE-okgo

OKGO solves the Golang nested-error-checking if-else hell
1 stars 0 forks source link

API deters usage of `defer` statements #1

Open angadn opened 6 years ago

angadn commented 6 years ago

Since each block of OKGO is within its own isolated function, defer statements that spread out across multiple blocks can't be used. Hence, references have to be shared across blocks and one mustn't forget to cleanup in the final block.

angadn commented 6 years ago

This is not a problem that is unique to OKGO. BDD Testing frameworks that expose a closure-driven API also have the same issue. Unless we have a simple enough variant within the extent of the current paradigm to allow for defers, we should probably drop this as a WONTFIX