All finalizers and cleanups run on a single goroutine started internally in the runtime. If a finalizer/cleanup calls Goexit, it will do what it says on the tin and exit the finalizer goroutine. No more finalizers/cleanups will run after that point.
At minimum, Goexit should probably detect this case and throw.
@ianlancetaylor put together https://go.dev/play/p/7jRsXx0W2OZ, which shows that the finalizers never run, but otherwise no error is reported.
cc @golang/runtime
All finalizers and cleanups run on a single goroutine started internally in the runtime. If a finalizer/cleanup calls Goexit, it will do what it says on the tin and exit the finalizer goroutine. No more finalizers/cleanups will run after that point.
At minimum, Goexit should probably detect this case and throw.
@ianlancetaylor put together https://go.dev/play/p/7jRsXx0W2OZ, which shows that the finalizers never run, but otherwise no error is reported.
cc @golang/runtime