Last active
October 20, 2019 11:23
-
-
Save Mayankgupta688/55614af24e9facba7c056651dbd3d4cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func recoveryFunction() { | |
fmt.Println("This is recovery function...") | |
} | |
func executePanic() { | |
defer recoveryFunction() | |
panic("This is Panic Situation") | |
fmt.Println("The function executes Completely") | |
} | |
func main() { | |
executePanic() | |
fmt.Println("Main block is executed completely...") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment