Comment on With book on Go, Kernighan guides students at Princeton and beyondparentComments−microtonal10yThis is a general property of most garbage collected languages - you don't know when a gc takes place (if ever) to run finalizers.For this reason Java has try-with-resources, C# using, Haskell bracket and Go defer.Note that you can attach a finalizer to a Go struct: https://golang.org/pkg/runtime/#SetFinalizer
Comments
This is a general property of most garbage collected languages - you don't know when a gc takes place (if ever) to run finalizers.
For this reason Java has try-with-resources, C# using, Haskell bracket and Go defer.
Note that you can attach a finalizer to a Go struct: https://golang.org/pkg/runtime/#SetFinalizer