Created
May 28, 2014 01:45
-
-
Save shockalotti/97151c32056592ce35e1 to your computer and use it in GitHub Desktop.
Go Golang - Defer, Panic function example
This file contains hidden or 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 main() { | |
defer func() { | |
str := recover() | |
fmt.Println(str) | |
}() | |
panic("PANIC") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment