Defer.jl provides simplified resource cleanup in Julia. When Julia programs interface with external resources (often wrapping external libraries), they must often arrange for those resources to be freed, closed, cleaned up, or otherwise disposed of after use. This package provides a golang inspired @defer macro to make it easier for users to free resources at the correct time.

This package is meant as a pathfinder for an eventual language feature that will take its place. In the meantime, it's usable in its current form. By adopting this convention now, you will be ready for the future and also help shape the language by determining which forms are most useful and which corner cases cause friction.