Skip to content

Instantly share code, notes, and snippets.

@taowen
Created March 2, 2018 02:18
Show Gist options
  • Save taowen/3d88c15e70f8c266423f4379400b483b to your computer and use it in GitHub Desktop.
Save taowen/3d88c15e70f8c266423f4379400b483b to your computer and use it in GitHub Desktop.
func ExampleUnboundedExecutor_Go_panic() {
concurrent.HandlePanic = func(recovered interface{}, funcName string) {
fmt.Println(funcName)
}
executor := concurrent.NewUnboundedExecutor()
executor.Go(willPanic)
time.Sleep(time.Second)
// output:
// github.com/modern-go/concurrent_test.willPanic
}
func willPanic(ctx context.Context) {
panic("!!!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment