Error Handling in Go
Error Handling in Go
error is an interface type with just one method: Error() string.
When panic happens, control ends immediately in the function and moves back up the call stack to the runtime. This happens unless there’s a recover somewhere in the call path.
Runtime panics cannot be recovered. Once the runtime panics, your program stops.