Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shockalotti/97151c32056592ce35e1 to your computer and use it in GitHub Desktop.

Select an option

Save shockalotti/97151c32056592ce35e1 to your computer and use it in GitHub Desktop.

Revisions

  1. shockalotti created this gist May 28, 2014.
    11 changes: 11 additions & 0 deletions Go Golang - Defer, Panic function example
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    package main

    import "fmt"

    func main() {
    defer func() {
    str := recover()
    fmt.Println(str)
    }()
    panic("PANIC")
    }