Skip to content

Instantly share code, notes, and snippets.

@Natata
Created August 20, 2017 07:47
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 Natata/5526b523ce0eb44129721470084fd979 to your computer and use it in GitHub Desktop.
Save Natata/5526b523ce0eb44129721470084fd979 to your computer and use it in GitHub Desktop.
func recoverFactory(f func()) func() {
rf := func() {
defer func() {
if r := recover(); r != nil {
fmt.Println("Recovered in f", r, "ker")
}
}()
f()
}
return rf
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment