Please provide some more information about what you are trying to do, and
how to reproduce your problem from scratch. Otherwise it will be hard to
provide you any help at all. For example, what code are you using? What
commands are you running? What goal are you trying to accomplish in the
Yah, that's true, I completely forgot about that. :/
I guess you could do what some others have done which is implement a Call
function or a framework that runs all function calls in a middleware-esk
style. And middleware has a recovery. So every call will have a recovery.
On Tuesday 26
On Tue, Dec 26, 2023 at 9:12 AM Gergely Brautigam wrote:
> If you have a top level recover in you main, it doesn't matter where the
> panic happens, you'll capture it. Even in third party library.
Iff the panic occurs in the same goroutine where the defer is. Every
go statement starts a new
If you have a top level recover in you main, it doesn't matter where the
panic happens, you'll capture it. Even in third party library.
package main
import (
"fmt"
"github.com/Skarlso/panic"
)
func main() {
defer func() {
if r := recover(); r != nil {
fmt.Println("Recovered in f", r)
}
}()