Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- )
- func main() {
- defer func() {
- err := recover()
- if err != nil {
- fmt.Println("Recover from panic")
- }
- }()
- panic("Some error")
- // It didn't occur.
- fmt.Println("More message")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement