How do I recover and continue from a panic (E.g. resume where I left off? Could do something like this (pseudocode):
func main() {
...code
defer errorfix()
....code..
....'overflow' panic
....code...
....'divide by zero' panic
....code...
}
func errorfix() {
if err := recover(); err !=nil {
... fix something based on err and then
return to retry
// or return to next line
// or panic('unknown error')
}
}
I think not. Once current program run into a panic, it would reclaim the stack your function (in your code, the main() ) had claimed, so you would not get the chance.