Last active
August 29, 2015 14:26
-
-
Save kaneshin/0dc89a40ca4ec04ae9b6 to your computer and use it in GitHub Desktop.
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 ( | |
"log" | |
"time" | |
) | |
// main ... | |
func main() { | |
log.Println("Begin: Main") | |
run() | |
log.Println("End: Main") | |
} | |
// run ... | |
func run() { | |
log.Println("Begin: Run") | |
defer func() { | |
recover() | |
}() | |
go func() { | |
// defer func() { | |
// recover() | |
// }() | |
sub() | |
}() | |
log.Println("End: Run") | |
time.Sleep(time.Second) | |
} | |
// sub ... | |
func sub() { | |
panic("PANIC") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment