Don't pause on panic
Whenever a panic occurs when debugging, GoLand pauses at line 681 of panic.go (func fatalpanic(msgs *_panic)), but I don't want it to pause there. I would like it to stop debugging and print the panic message. I can't find an option to toggle this in the Debug pane nor in settings. Is there a way to change this behavior? Thank you.
Please sign in to leave a comment.
Hi. GoLand uses `delve` as a debugger. And pausing on panics is expected behavior of the `delve`, it was implemented here:
https://github.com/go-delve/delve/issues/317
There is no option to disable it, `delve` itself should implement that first. Anyway, I created a feature request in our issue tracker:
https://youtrack.jetbrains.com/issue/GO-6981
I was also trying to prevent GoLand from stopping on panic and somehow managed to make it so that it doesn't stop at all even if the app has crashed. I think I removed the breakpoint? How could I restore this behaviour?
Hello, most likely, you have disabled the "Suspend" option in the "View Breakpoints" window. I have attached a screenshot of where this is turned back on. After enabling, you need to restart the debug session. Does it help?
Appreciate the quick response!
I have the breakpoint Enabled checked, Suspended unchecked, and the rest of the dialog is exactly the same.
I have restarted the debugger several times, but it still doesn't stop at the breakpoint when there's a panic.
EDIT: I had misread the response, apologies. Checking the Suspend option indeed works, thanks!