Comment Comment by pjmlp This is Go, yet add again, catching up to the lessons learned by the other programming language communities.As you point out, finalizers are no longer in good grace in Java, not even in .NET, but lets leave that for another thread.Hence why they are deprecated since Java 9, released in 2017, and a Cleaner queue should be used instead, or try-with-resources.https://docs.oracle.com/javase/9/docs/api/java/lang/Object.h...Basically runtime.AddCleanup() is the Go's version of java.lang.ref.Cleaner::register(). parent pjmlp 1 year ago
As you point out, finalizers are no longer in good grace in Java, not even in .NET, but lets leave that for another thread.
Hence why they are deprecated since Java 9, released in 2017, and a Cleaner queue should be used instead, or try-with-resources.
https://docs.oracle.com/javase/9/docs/api/java/lang/Object.h...
Basically runtime.AddCleanup() is the Go's version of java.lang.ref.Cleaner::register().