Is there an idiomatic and/or nice way to do something like the opposite of init(), to run some code in package scope when a program finishes? The use case is tearing down things (mock servers, for example) that were set up for test cases. I can only think of hacky ways to do it.
Is there an idiomatic and/or nice way to do something like the opposite of init(), to run some code in package scope when a program finishes? The use case is tearing down things (mock servers, for example) that were set up for test cases. I can only think of hacky ways to do it.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Is there an idiomatic and/or nice way to do something like the opposite of init(), to run some code in package scope when a program finishes? The use case is tearing down things (mock servers, for example) that were set up for test cases. I can only think of hacky ways to do it.