Skip to content

Instantly share code, notes, and snippets.

@Mayankgupta688
Last active October 20, 2019 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mayankgupta688/55614af24e9facba7c056651dbd3d4cc to your computer and use it in GitHub Desktop.
Save Mayankgupta688/55614af24e9facba7c056651dbd3d4cc to your computer and use it in GitHub Desktop.
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