Go is the language with the automatic memory management: garbage collector without a programmer participation will free up memory previously allocated for objects that are not in use anymore. But all automation in general is limited to memory and we still need to manually clean up all other resources accuired by the program.

The only thing that the GC can offer for resource cleanup automation is to call a finalizer registered via the runtime.SetFinalizer function. But this mechanism does not guarantee either the finalzers call order or even that the finalizer will be called at all. …

Alexey A Maximov

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store