3 ms·
I think you could easily write a function that defers a handler that will swallow any errors or send them on a channel and calls the supplied function. Instead
by ekiru 17y ago
I think you could easily write a function that defers a handler that will swallow any errors or send them on a channel and calls the supplied function.
Instead of "go foo()", you would "go dontPanic(foo)" or "go panicToChan(foo, errChan)".
I'm fairly certain this would work, and similar things are discussed in the replies to the linked post, but I haven't written much Go at all, so I can make no guarantees.
- btilly 17y agoYou have to do that for every goroutine that is launched. There can be a lot of them.