Go by Example: Panic
Go by Example : Panic
Running this program will cause it to panic, print an error message and goroutine traces, and exit with a non-zero status. | |
When first panic in
|
|
| |
Note that unlike some languages which use exceptions for handling of many errors, in Go it is idiomatic to use error-indicating return values wherever possible. |
Next example: Defer .