Re: [go-nuts] proposal: advise using SetFinalizer to detect resource leaks

2018-04-05 Thread Mateusz Czaplinski
I replied on the issue; in short, if the proposal gets dismissed, I'll take my chances at creating a third-party package with some super simple API, and then try advertising it here, on reddit, and maybe to other packages. On Thu, Apr 5, 2018 at 2:14 PM, Axel Wagner

Re: [go-nuts] proposal: advise using SetFinalizer to detect resource leaks

2018-04-05 Thread 'Axel Wagner' via golang-nuts
Of course this happens when you don't test your code ^^ Here is a version without compilation errors and with a quick demo: https://play.golang.org/p/ykO4igrC0b1 On Thu, Apr 5, 2018 at 2:06 PM, Axel Wagner wrote: > On Thu, Apr 5, 2018 at 1:58 PM, Mateusz

Re: [go-nuts] proposal: advise using SetFinalizer to detect resource leaks

2018-04-05 Thread 'Axel Wagner' via golang-nuts
On Thu, Apr 5, 2018 at 1:58 PM, Mateusz Czaplinski wrote: > Reading from it and handling the errors is left to user. > Then why would this need to live in the stdlib? For example here is a quick and dirty implementation that allows the same functionality, without having to

Re: [go-nuts] proposal: advise using SetFinalizer to detect resource leaks

2018-04-05 Thread Mateusz Czaplinski
Reading from it and handling the errors is left to user. There are many possible ways to handle it, so it's hard to guess in the finalizer what user wants: a) print them on stderr b) push them to some logging infrastructure c) just plain ignore them (default behavior) User may not want or

Re: [go-nuts] proposal: advise using SetFinalizer to detect resource leaks

2018-04-05 Thread 'Axel Wagner' via golang-nuts
What would the runtime.Leaks channel do with the received errors? Why can't you just do the same thing from the finalizer itself? On Thu, Apr 5, 2018 at 1:43 PM, Mateusz CzapliƄski wrote: > Based on a recent discussion on reddit, and a reply by BowsersaurusRex: > > "In