Skip to content

Instantly share code, notes, and snippets.

@legendtkl
Last active May 18, 2016 06:03
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 legendtkl/09caa1f6e63320a0a5a26b5ed4e9bcc9 to your computer and use it in GitHub Desktop.
Save legendtkl/09caa1f6e63320a0a5a26b5ed4e9bcc9 to your computer and use it in GitHub Desktop.
//error handle
//when exit, print stack out
func foo() {
if err := recover(); err != nil {
debug.PrintStack()
log.Error("Error: ", err)
}()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment