Created
March 2, 2018 02:18
-
-
Save taowen/3d88c15e70f8c266423f4379400b483b to your computer and use it in GitHub Desktop.
This file contains 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
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