Skip to content

Instantly share code, notes, and snippets.

@legendtkl
Last active May 18, 2016 06:03
Show Gist options
  • Save legendtkl/09caa1f6e63320a0a5a26b5ed4e9bcc9 to your computer and use it in GitHub Desktop.
Save legendtkl/09caa1f6e63320a0a5a26b5ed4e9bcc9 to your computer and use it in GitHub Desktop.

Revisions

  1. legendtkl renamed this gist May 18, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. legendtkl created this gist May 18, 2016.
    8 changes: 8 additions & 0 deletions golang_gist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    //error handle
    //when exit, print stack out
    func foo() {
    if err := recover(); err != nil {
    debug.PrintStack()
    log.Error("Error: ", err)
    }()
    }